home bbs files messages ]

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,639 of 117,927   
   Ruvim to Ruvim   
   Re: recursion   
   16 Jul 24 15:52:20   
   
   From: ruvim.pinka@gmail.com   
      
   On 2024-07-16 11:55, Ruvim wrote:   
   > On 2024-07-15 23:37, Ruvim wrote:   
   >>   
   >>   
   >> An even more better and more general approach:   
   >>   
   >>    : binom ... forward binom ... ;   
   >>   
   >>   
   >>    : binom ... forward:binom ... ;   
   >>   
   >> The later one can also be used as:   
   >>   
   >>    : foo ... ['] forward:foo ... ;   
   >>   
   >>   
   >> An advantage of this approach is that it is more general than the   
   >> "recursive" word, and you also don't have to repeat the definition name.   
   >   
   >   
   > One more advantage of this approach is that it works as expected when   
   > the compilation word list is absent in the search order. Because the   
   > reference in a definition is resolved once the forwarded word name is   
   > placed in the same compilation word list (regardless of the search order).   
      
      
   A low-level API (porcelain) to implement this functionality can be   
   represented by the following words:   
      
      forward-lit, ( -- x.lit-sys )   
      forward-call, ( -- x.call-sys )   
      
      compile-lit ( x x.lit-sys -- )   
      compile-call ( xt x.call-sys -- )   
      
      
   Or which names are better?   
      
      
   Conceptually, the standard words can be defined as:   
      
      : compile, ( xt -- ) forward-call, compile-call ;   
      : lit, ( x -- ) forward-lit, compile-lit ;   
      : literal state @ if lit, then ; immediate   
      
      
      
   --   
   Ruvim   
      
   --- 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