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,638 of 117,927   
   Ruvim to Gerry Jackson   
   Re: recursion   
   16 Jul 24 11:40:07   
   
   From: ruvim.pinka@gmail.com   
      
   On 2024-07-16 02:41, Gerry Jackson wrote:   
   > On 15/07/2024 20:37, Ruvim wrote:   
   >>   
   >>>>   
   >>>> RECURSIVE also allows you to tick the word in its own definition (not   
   >>>> possible with RECURSE), a feature that I actually have used;   
   >>   
   >> I think, there should be a standard method to get the xt of the   
   >> current definition (regardless whether it is a named definition, or   
   >> nameless definition).   
   >>   
   >   
   > It can be done by using DEFER as a forward definition   
   > e.g.   
   > defer foo   
   > :noname ... ['] foo defer@ ... ; is foo   
      
   Or this way:   
      
      variable _foo   
      :noname ... _foo @ ... ; _foo !   
      
      
   Of course, in some particular cases this can be done in a standard way.   
      
   But what if we are creating the definition programmatically? Things   
   become more cumbersome without intrinsic necessity.   
      
      
   And this is not an API —  this is not a method of getting the xt of the   
   current definition in the general case.   
      
   In the general case, you don't know how compilation of the current   
   definition was started, and you cannot require a special way of starting   
   compilation of the definition.   
      
      
      
      
   >   
   > using DEFER@ gives the xt of the code, omittimg it gives the xt of the   
   > name.   
      
   In this use case the named definition (created by "defer") is only   
   auxiliary, its xt is not needed.   
      
      
   [...]   
      
   > As DEFER can be used as a forward definition it can also be used for   
   > mutual recursion   
   >   
      
   This is possible but, awkward. Why else do some systems provide the   
   words like "recursive" and "forward"?   
      
      
   --   
   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