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 117,899 of 117,927   
   albert@spenarnc.xs4all.nl to Anton Ertl   
   Re: Recognizer proposal   
   13 Feb 26 12:25:49   
   
   In article <2026Feb11.193710@mips.complang.tuwien.ac.at>,   
   Anton Ertl  wrote:   
   >jkn  writes:   
   >>I was a bit surprised that "a space delimits 'symbols'" has not been   
   >>made more flexible...   
   >   
   >Lack of demand.  For Forth source white space as delimiter is deeply   
   >rooted, and I have not seen any desire to change that.  Bernd Paysan   
   >has used the text interpreter with appropriate recognizers for parsing   
   >other kinds of input (e.g., .ini files), but I have not heard any   
   >desire to change the parsing part of the text interpreter, either.  In   
   >any case, the recognizers work with what comes out of the parsing   
   >part, so changing the parsing part would be a separate, mostly   
   >independent proposal.   
      
   I consider it a design error that word / parse are obliged   
   to consume the end delimiter. Especially in view that parsing always   
   skips leading delimiters. This makes both unusable as factor for the   
   forth engine. This was a cute idea in the 70's where space delimiting   
       17 12 GCD   1001 LCM   
   was all the rage, before strings were invented.   
   BASIC beats Forth in this respect.   
      
   Combined with PREFIXes this change can dramatically simplify Forth.   
   There is no need to chop the input in pieces.   
   Kill the guy with the moustache! (from starting Forth).   
   If you lookup DROP this doesn't match DROP-FLOAT.   
   If DROP is a prefix. You have certainly a match.   
   It matches glossary "DR" also, but you accept it only if the "DR"   
   is a prefix. Else you discard it because in the input stream DR is not followed   
   by white space. These exceptions are processed afterwards.   
      
   What remains is a pointer in the input stream, much like normal   
   languages. This diminishes stack depth where it is mostly needed.   
   My FOUND uses (FIND) that in turn uses ~MATCH.   
      
   In the ciforth model I can add a one-screen addition, vectoring TOKEN   
   to NAME. Now you can parse lisp and pascal without changing the soul   
   of the parsing part of Forth.   
   I have demonstrated it with the gnu lisp interpreter. A large part   
   was a parser that distracts from the lisp goal,   
   leaving the impression that Forth is an awkward language.   
      
   >   
   >- anton   
      
   Groetjes Albert   
   --   
   The Chinese government is satisfied with its military superiority over USA.   
   The next 5 year plan has as primary goal to advance life expectancy   
   over 80 years, like Western Europe.   
      
   --- 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