Category:Forth: Difference between revisions
Content deleted Content added
mention ANS standard forth; common extension words |
No edit summary |
||
Line 12: | Line 12: | ||
: bounds ( addr len -- limit addr ) over + swap ; \ convert string/array to DO-LOOP limits |
: bounds ( addr len -- limit addr ) over + swap ; \ convert string/array to DO-LOOP limits |
||
DEFER-IS for late-bound, revectorable, and forward-referenced words: |
|||
⚫ | |||
: noop ( -- ) ; |
|||
: defer create ( "name" -- ) ['] noop , does> ( -- ) @ execute ; |
|||
: is ( xt "name" -- ) ' >body ! ; |
|||
defer lessthan |
|||
' < is lessthan |
|||
2 3 lessthan . \ -1 (true) |
|||
⚫ | |||
: muldiv { a b -- a*b a/b } \ all stuff after "--" is ignored |
: muldiv { a b -- a*b a/b } \ all stuff after "--" is ignored |
||
a b * a b / ; |
a b * a b / ; |