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,838 of 117,927   
   Anton Ertl to Ruvim   
   Re: value-flavoured structures   
   04 Oct 24 18:04:14   
   
   From: anton@mips.complang.tuwien.ac.at   
      
   Ruvim  writes:   
   >On 2024-10-04 15:52, Anton Ertl wrote:   
   >> It can be defined: Gforth has SET-TO   
   ...   
   >I wonder why a kind of "TO" is not used to set this field/property, and   
   >*maybe* a kind of "ACTION-OF" to get this property.   
      
   Interesting idea.  Maybe in some future version.   
      
   >> However, lots of Forth programmers have defined VALUEs, and barely any   
   >> have defined getters and setters.   
   >   
   >Do you mean that this is due to some advantages in *using*?   
   >   
   >I think, this is because `VALUE` (and co.) is a very old technique that   
   >is provided out of the box by many systems.   
      
   Yes.  Writing getters and setters is also provided out of the box.   
      
   variable addr-x   
   : x addr-x @ ;   
   : set-x addr-x ! ;   
      
   For some reason, people have not written getters and setters.  The   
   lack of flexibility of standard TO has not deterred them from using   
   that.   
      
   >In contrast, to use   
   >separate getters and setters you need to create your own tool to define   
   >them.   
      
   Obviously not, see above.  What tool do you have in mind?   
      
   >> The discussions have been aboyt   
   >> values vs. variables, not about values vs. getters and setters.   
   >   
   >This shows that some people don't like the to-based approach.   
      
   Does it?  Are they using getters and setters instead?  No.   
      
   >I seen that some implementers provide "value" and "to" only for third   
   >party programs and don't use them themselves.   
      
   Which ones?  Typing WHERE TO right after startup in Gforth and in   
   SwiftForth shows a number of uses of TO in both systems.   
      
   - anton   
   --   
   M. Anton Ertl  http://www.complang.tuwien.ac.at/anton/home.html   
   comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html   
        New standard: https://forth-standard.org/   
      EuroForth 2024: https://euro.theforth.net   
      
   --- 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