Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!rice!uw-beaver!zephyr.ens.tek.com!tekcrl!tekgvs!toma From: toma@tekgvs.LABS.TEK.COM (Tom Almy) Newsgroups: comp.lang.forth Subject: Re: New Directions: Forth is not postfix Message-ID: <6719@tekgvs.LABS.TEK.COM> Date: 22 Jan 90 16:14:45 GMT References: <284.UUL1.3#5129@willett.UUCP> <2243@psueea.UUCP> Reply-To: toma@tekgvs.LABS.TEK.COM (Tom Almy) Organization: Tektronix, Inc., Beaverton, OR. Lines: 25 In article <2243@psueea.UUCP> scowl@eecs.UUCP (Scott W. Larson) writes: >In article <284.UUL1.3#5129@willett.UUCP> dwp@willett.UUCP (Doug Philips) writes: >What if I want to >write a new ':' that does what ':' does, but gets the name of >the new definition from somewhere other than input. It would >be much more flexible to have colon work like this: > > " MyDef" : > Well, STOIC worked this way, and it was certainly convenient. String arguments in Forth are one of three things that cause the most confusion for new Forth programmers (no conditionals in interpret state, and the use of "." to make a double integer are the other two). Although it doesn't help for colon, LMI Forths have take the approach in most "extension" words of defining a function ~foo which takes a string argument, and another function foo that reads the string from the input stream. foo is defined in terms of ~foo as : foo bl feed ~foo ; immediate where the function feed is a state smart version of WORD. Personally I wish it weren't state smart, but at least the tilde functions are available. Tom Almy toma@tekgvs.labs.tek.com Standard Disclaimers Apply