Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!decwrl!ucbvax!PENNDRLS.BITNET!DAVID From: DAVID@PENNDRLS.BITNET Newsgroups: comp.lang.forth Subject: Postfixer FORTH Message-ID: <9008152018.AA23733@ucbvax.Berkeley.EDU> Date: 15 Aug 90 15:13:41 GMT Sender: daemon@ucbvax.BERKELEY.EDU Reply-To: DAVID%PENNDRLS.BITNET@SCFVM.GSFC.NASA.GOV Organization: The Internet Lines: 46 How about this for a more postfix FORTH syntax: " SomeWord" Is 20 Constant " *2" Is : 2 * ; 'Is' factors out Create without changing the compiler significantly. The Name field still gets laid down first. Defining words then lay down a Code field at the current location, which is conveniently right where it should go. Another idea I've been fooling with arose from a previous discussion of Vocabularies as string recognizers. The argument was to enlarge the scope of Number by implementing Vocabularies as generalized string recognizers, with most of them doing it through table lookup in the dictionary, but Number and similar routines doing it alogorithmically. For instance, you could allow "x" to be recognized as a character constant just as 5 is recognized as a numerical constant. So, how about a recognizer that is a mixture? Suppose we have a word that recognizes tokens of the form 'Something' as being a reference to the CFA of the word Something? The Interpreter would leave the CFA on the stack, the Compiler would compile it as a litteral. We could then say Defer FooBar 'Fred' 'FooBar' Is : FooFred 'Fred' 'FooBar' Is ; (to use Is in its more common meaning). I think this is much prettier. And more postfix. Once started down this path, though, you start to get into a lot of delimited strings. For instance, "Something" could be Something as a string constant, could be the Body address of Something, and [Something] could Compile Something even if Something is Immediate. I'm not sure I want to go that far, but . . . "Fred" Is Immediate : Fred's Action ; "CompFred" Is : Some Extra [Fred] Actions ; "FooBar" Is Defered "FooFred" Is : 'Fred' ! ; Now for the Big Question. Would this still be FORTH? I think it would be. But it would *not* be Chuck Moore Forth, or ANS FORTH. -- R. David Murray (DAVID@PENNDRLS.BITNET, DAVID@PENNDRLS.UPENN.EDU)