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,951 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 117,216 of 117,951   
   albert@spenarnc.xs4all.nl to Anton Ertl   
   Re: Word name storage quirk in VAX fig-F   
   17 Apr 25 14:30:43   
   
   In article <2025Apr16.181856@mips.complang.tuwien.ac.at>,   
   Anton Ertl  wrote:   
   >David Meyer  writes:   
   >>I've been dusting-off fig-Forth for VAX-11 and noticed that every word   
   >>in the dictionary has 128 added to the character code of the last   
   >>character in the word name.   
   >...   
   >>Is there some   
   >>peculiarity in fig-Forth or the VAX-11 (I'm using significantly later   
   >>hardware and OS) that made this work correctly back in the day?   
   >   
   >David Schultz gave the answer to why VLIST works in fig-Forth.   
   >   
   >Here's the reason why the last bit is set: Fig-Forth has "variable   
   >length names" as headline feature, whereas earlier Forth systems only   
   >stored the length and 3 characters (i.e., VLIST would output its own   
   >name as VLI__ or so), and would match/conflict with, e.g., VLIKE.   
   >   
   >But unlike modern systems, fig-Forth does not always store the full   
   >length of the name.  Instead, you could set the length of the number   
   >of characters to be stored by setting a variable.  That variable can   
   >change from one definition to the next, so you do not know from this   
   >variable how many characters are stored for a particular name.   
   >Instead, you know the last stored character by looking whether the   
   >most significant bit is set (the most significant bit of the   
   >count+flags byte is also set to allow finding it from the other end.   
      
   This allowed to define $.... as a word, storing the length (5) and   
   only one letter of the name.   
   So any word like $1AC4 matches, and $ could try to find out what   
   number was meant. $QQQQ gives an error. So you could have a   
   hex number without changing BASE.   
      
   This is similar to PREFIX in ciforth:   
   : $  (NUMBER) .... ; PREFIX IMMEDIATE   
   The difference is that the name of $ matches any word that commences   
   with $ , e.g. $1AC4 and $QQQQRRRR , governed by a bit in the flag field   
   of $.   
   The prefix has the responsability to advance the parse pointer (aka >IN)   
   unlike in fig-Forth. The parse pointer was left immediately behind $.   
   PREFIXes can handle arbitrary length and strings containing blank space.   
      
   >   
   >- anton   
   --   
   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-DOS v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca