Advertisement
KipIngram

Untitled

May 19th, 2023 (edited)
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. meta definitions
  2.  
  3. ( .table creates a table with "wipable" header)
  4. .table <cases> case-; case-;; case-me 0
  5. .table <conditions> cond<= cond< cond= cond!= cond>= cond> 0
  6. .table <implicits> imp-0 imp-null 0
  7. .table <signs> sign-u sign-null 0
  8. .table <dots> dots-. dots-null 0
  9.  
  10. .: gen ( dot-item sign-item implicit-item condition-item case-item --) { ...generate one primitive... 5 } ;
  11.  
  12. ( Operation of iterate-on:
  13. 1. Takes a table address p on the stack. Proceed as follows:
  14. a. Pop p from data stack.
  15. b. Set q = *p++ (post increment p)
  16. c. If q == 0, increment return address one cell and return.
  17. d. Push q to data stack and execute word at return address.
  18. e. Go to b.
  19. Note: save p on return stack while executing in d.
  20. )
  21.  
  22. .: foo1 <cases> iterate-on gen ;
  23. .: foo2 <conditions> iterate-on foo1 ;
  24. .: foo3 <implicits> iterate-on foo2 ;
  25. .: foo4 <signs> iterate-on foo3 ;
  26. .: doem <dots> iterate-on foo4 ;
  27.  
  28. target definitions
  29.  
  30. doem ( this generates all the primitives into the dictionary)
  31.  
  32. meta definitions .wipe
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement