Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.lang.forth    |    Forth programmers eat a lot of Bratwurst    |    117,927 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 116,640 of 117,927    |
|    sjack to Anton Ertl    |
|    Re: recursion    |
|    16 Jul 24 12:02:39    |
   
   From: sjack@dontemail.me   
      
   Anton Ertl wrote:   
   > forward foo   
   >   
   > : bar ( n -- ) dup . 1- foo ;   
   >   
   > : foo ( n -- ) dup 0> if bar else drop then ;   
   >   
   > 5 foo \ prints "5 4 3 2 1 "   
   >   
      
      
   Toad code using Wil Baden type local macros ( /MM: MM ):   
      
   "dup . 1- myself" /mm: bar OK   
      
   : foo dup 0> if mm bar else drop then ; OK   
      
   5 foo 5 4 3 2 1 OK   
      
   Note: The macro BAR does not remain in the system image.   
   --   
   me   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca