In article ,   
   Stephen Pelc wrote:   
   >On 31 Oct 2024 at 17:30:45 CET, "mhx" wrote:   
   >   
   >> With vocabularies it quickly becomes a pain when,   
   >> e.g., defining words in A, switching to B to define   
   >> something there, go back to A and define some more   
   >> words ... At least it is when trying to FORGET stuff.   
   >> (Assuming you *have* FORGET).   
   >   
   >The FORGET issue is mostly a red herring because of compile speed; for   
   >code less than 100k lines we use EMPTY to clean the dictionary and then   
   >start again. 1M lines of code take about 30 seconds to compile.   
      
   Forget is a relic from the time you had blocks on mag tape and   
   you hoped to avoid the rewinding.   
      
   >   
   >> It is also messy to write a definition that needs   
   >> words from different vocabularies.   
   >> ( Like a book with footnotes that span multiple pages,   
   >> or where a chapter can not be read on its own. )   
   >>   
   >> How did you solve that complexity?   
   >   
   >Gerald Wodni implemented the VOC-DOT notation for VFX as a   
   >recogniser. To reference a word in another vocabulary, just use   
   > .   
   >This notation has proven to be very useful, especially when dealing   
   >with a range of byte-oriented serial devices, e.g:   
   > i2c.emit   
   > spi.emit   
   >   
   >The notation also reads well. I have no idea who invented it originally   
   >and where the original source code is.   
      
   Once the concept of PREFIX sinks in,   
   it is pretty trivial, (using voc's with builtin ALSO. 1] )   
      
   NAMESPACE APE   
   : APE. APE NAME EVALUATE PREVIOUS ;   
   ( "NAME EVALUATE" is present under various names, i.e. WINTERPRET in noforth)   
   \ Now define something in the wordlist :   
   APE DEFINITIONS 12 CONSTANT ORANGUTAN PREVIOUS DEFINITIONS   
   ( back in Forth)   
   APE. ORANGUTAN .   
   12 OK   
   : APE. APE NAME EVALUATE PREVIOUS ; PREFIX   
   APE.ORANGUTAN .   
   12 OK   
   : APE. APE NAME EVALUATE PREVIOUS ; PREFIX IMMEDIATE   
   : test APE.ORANGUTAN ;   
   test .   
   12 OK   
      
   All this is defined by facilities present in the simplest of Forth.   
   Except PREFIX , that cost two or three lines in a kernel. 2]   
      
      
   1] not essential, but I publish only tested code.   
   2] in a well designed Forth.   
      
   >Stephen Pelc, stephen@vfxforth.com   
      
   Groetjes Albert   
   --   
   Temu exploits Christians: (Disclaimer, only 10 apostles)   
   Last Supper Acrylic Suncatcher - 15Cm Round Stained Glass- Style Wall   
   Art For Home, Office And Garden Decor - Perfect For Windows, Bars,   
   And Gifts For Friends Family And Colleagues.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|