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,674 of 117,927   
   albert@spenarnc.xs4all.nl to no.email@nospam.invalid   
   Re: VALUE and TO implementation   
   08 Aug 24 11:25:51   
   
   In article <87le18rurj.fsf@nightsong.com>,   
   Paul Rubin   wrote:   
   >albert@spenarnc.xs4all.nl writes:   
   >> Numbers (also denotations, such as strings)  must be smart.   
   >   
   >I've thought of having non-smart numbers in a small Forth.  Instead of   
   >123 you would say # 123 or something similar, where # is a parsing word   
   >that emits LIT and the number.  I remember that the eForth metacompiler   
   >does something like that, to handle the case where the host and target   
   >processors have differing number representations (e.g. word sizes).   
      
   I don't think that would count as non-smart numbers.   
   A long time ago I demonstrated handling denotations (numbers)   
   in INTERPRET . Reminder denotations are constant and the same   
   in either mode.   
   It requires that there is a separate compilation stack.   
      
   As soon as INTERPRET detects that a word (obviously immediate)   
   leaves something on the stack, and it is in compilation state,   
   it compiles one or more literals.   
   That is in the context of PREFIXes. 0x is a prefix immediate.   
   0x1234 gets control and generates hex 1234 . INTERPRET takes   
   cares of the rest.   
   Bottom line, that is the single location in the whole Forth   
   where STATE is inspected.   
      
   In ciforth I don't go that far, but all denotations ends in a   
   call to LITERAL/DLITERAL which comes close.   
      
   Groetjes Albert   
      
   >   
   --   
   Don't praise the day before the evening. One swallow doesn't make spring.   
   You must not say "hey" before you have crossed the bridge. Don't sell the   
   hide of the bear until you shot it. Better one bird in the hand than ten in   
   the air. First gain is a cat purring.            - the Wise from Antrim -   
      
   --- 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