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 117,017 of 117,927    |
|    sjack to dxf    |
|    Re: "Back & Forth" - Local variables    |
|    10 Jan 25 15:50:47    |
   
   From: sjack@dontemail.me   
      
   dxf wrote:   
      
   > Great. While I've seen co-routines mentioned, examples were rare so I   
   > tended to ignore it.   
   >   
      
   -- A closed paren defined as an immediate co-routine can be used at   
   -- compile time to divide a word into two parts.   
   -- At run-time the word's first part executes then performs co-routine   
   -- and somewhere down the input ')' performs co-routine to return control   
   -- back to the the word's second part.   
   -- : foo( first part ) second part ;   
   -- Example:   
      
   : foo( ." --> " s0 @ sp! ) begin depth while 5 * . repeat ; OK   
      
   foo( 3 2 1 ) --> 5 10 15 OK   
      
   I use 'hi( foo bar baz )' to highlight the output of a sequence of   
   Forth words.   
      
   --   
   me   
      
   --- SoupGate-DOS v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca