+++ /dev/null
- Conditionals & loops\r
- ------------------\r
-\r
-if ( flag -- ) (immideate)\r
- "if 1.. else 2.. then" or\r
- "if 1.. then" construction. Conditional execution.\r
- Performs "1.." if "flag" was true,\r
- elseway performs "2.." if exist. Execution continues after\r
- word "then".\r
- ex: 1 if ." nonzero" else ." zero" then\r
-\r
->= ( n1 n2 -- result ) true if (n1 = n2) or (n1 > n2)\r
- ex: 5 3 >= if ." first number is greater or equal" then\r
-\r
-<= ( n1 n2 -- result ) true if (n1 = n2) or (n1 < n2)\r
-= ( n1 n2 -- result ) true if n1 = n2\r
-\r
-do ( count -- ) (immideate)\r
- "do .. loop" construction. Performs ".." "count" times.\r
- In every step "count" is decareased until it is 0.\r
- ex: : test 5 do i .d loop ;\r
- result: 4 3 2 1 0\r
-\r
-doexit ( -- ) exit from "do .. loop"\r
-\r
-for ( count top -- ) (immideate)\r
- "for .. loop" construction. Performs ".." (top - count) times.\r
- In every step "count" is incareased until it reaches "top" .\r
- ex: : test 4 10 for i .d loop ;\r
- result: 4 5 6 7 8 9\r
-\r
-forexit ( -- ) exit from "for .. loop"\r
-\r
-until ( -- ) (immideate)\r
- "until .. loop" construction. Performs ".." until flag become\r
- true. False by default. Top of return stack holds flag.\r
-\r
-done ( -- ) exit from "until .. loop"\r
-\r