Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!pt.cs.cmu.edu!dsl.pitt.edu!pitt!willett!dwp From: dwp@willett.pgh.pa.us (Doug Philips) Newsgroups: comp.lang.forth Subject: Re: Vocabularies Message-ID: <1530.UUL1.3#5129@willett.pgh.pa.us> Date: 16 Aug 90 04:45:38 GMT References: <1529.UUL1.3#5129@willett.pgh.pa.us> Organization: String, Scotch tape, and Paperclips. (in Pgh, PA) Lines: 49 In <1529.UUL1.3#5129@willett.pgh.pa.us>, W.FEDERICI writes: > I am constantly surprised that in all these prefix/postfix debates, no one > seems to point out that Forth's CREATE is really not a prefix operator -- > rather, it is a function which parses a name from the current input stream, > where ever that may be. This is a hairsplitting distinction, and one which > probably wouldn't occur to users of conventional languages whose compiler > isn't a "distributed process", but I believe its neglect is a primary reason > that beginners have problems with CREATE...DOES> defining words. I see where you are coming from, I think. The classification of prefix postfix doesn't have to do with a strict ordering of source code words. Just because you can bury CREATE inside a colon definition and execute it later has nothing to do with whether or not it is "prefix". CREATE is prefix because it does *not* take an argument on the stack. CREATE is prefix because it cosumes INPUT after it starts executing. CREATE or words that have CREATE compiled in to them violate the idea that Forth is a series of words that are executed in turn. The idea that the sequence: FOO BAR BAZ BLETCH results in executing the code for FOO followed by executing the code for BAR, etc... breaks down when in fact BAR contains a CREATE and results in BAZ not being executed but rather being "quoted" by BAR. If BAR is appropriately spelled, it *may* be obvious that it is quoting the next word. That doesn't change the "prefix" nature of CREATE. > Seen in this light, the arguments for a "postfix" CREATE ( or colon, or > VARIABLE or...) are simply another case of deciding how to factor a function -- > do we want to separate the name-parsing from the definition-creation? I'm > sure most of us have encountered cases where we need this factoring. (I'm > still comfortable with the normal Forth syntax for normal circumstances.) This is precisely the issue. Are the non-postfix Forth words built from reusable components or not? Considering the fanatical factoring in Forth, one wonders why some words are so poorly factored. I guess CM is merely a genius and not a diety. :-) :-). (BTW: Just because Forth has traditionally been filled with mixed-fixed words doesn't mean it can't grow into a more cleanly factored language which contains both the old style prefix words *and* the components that such words are built from. I'm still not clear on how much you can bend Forth and still call it Forth. Fig-Forth, Forth-79, Forth-83. Perhaps in the end it is merely the philosophy which allows you to call the language Forth. But this is really a different topic). -Doug --- Preferred: ( dwp@willett.pgh.pa.us OR ...!{sei,pitt}!willett!dwp ) Daily: ...!{uunet,nfsun}!willett!dwp [last resort: dwp@vega.fac.cs.cmu.edu]