Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- meta definitions
- ( .table creates a table with "wipable" header)
- .table <cases> case-; case-;; case-me 0
- .table <conditions> cond<= cond< cond= cond!= cond>= cond> 0
- .table <implicits> imp-0 imp-null 0
- .table <signs> sign-u sign-null 0
- .table <dots> dots-. dots-null 0
- .: gen ( dot-item sign-item implicit-item condition-item case-item --) { ...generate one primitive... 5 } ;
- ( Operation of iterate-on:
- 1. Takes a table address p on the stack. Proceed as follows:
- a. Pop p from data stack.
- b. Set q = *p++ (post increment p)
- c. If q == 0, increment return address one cell and return.
- d. Push q to data stack and execute word at return address.
- e. Go to b.
- Note: save p on return stack while executing in d.
- )
- .: foo1 <cases> iterate-on gen ;
- .: foo2 <conditions> iterate-on foo1 ;
- .: foo3 <implicits> iterate-on foo2 ;
- .: foo4 <signs> iterate-on foo3 ;
- .: doem <dots> iterate-on foo4 ;
- target definitions
- doem ( this generates all the primitives into the dictionary)
- meta definitions .wipe
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement