From: krishna.myneni@ccreweb.org   
      
   On 10/4/25 11:53 AM, Anton Ertl wrote:   
   > Gerry Jackson writes:   
   >> I would suggest that you start with mini-oof & xmini_oof to see how they   
   >> can be used as these are much simpler than Anton's object.fs which is a   
   >> more complete OO system. Once you see how mini_oof can be used in LexGen   
   >> and/or Krishna's epr-sim.4th you can move on to object.fs.   
   >   
   > But given that so many people found mini-oof good enough to work with   
   > it, or to base their own extension on it, maybe the "more complete"   
   > part of object.fs as actually not needed that often.   
   >   
   > One thing that Bernd Paysan found missing in mini-oof is THIS, i.e., a   
   > handle for the current object.   
      
   We needed "this" for use in our code at work. In those instances where   
   it was needed, it was simple enough to implement and use within the   
   framework of mini-oof.fs in the following manner:   
      
    class \ define a class derived from class x   
    ... \ specify vars and members   
   end-class    
      
   For every class member of which needs "this", define the member as   
   follows,   
      
   0 ptr this \ ptr is synonymous with VALUE in ANS Forth   
   :noname ( o -- )   
    to this   
    ...   
    this V1 @ \ V1 is a var which belongs to the class for object o   
    ...   
    defines    
      
   Each member saves the object pointer passed to it on the stack and   
   allows "this" to reference the vars or members of that object.   
      
      
   --   
   Krishna   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|