Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!decwrl!ucbvax!MITCH.ENG.SUN.COM!wmb From: wmb@MITCH.ENG.SUN.COM (Mitch Bradley) Newsgroups: comp.lang.forth Subject: Quote Message-ID: <9008291904.AA11122@ucbvax.Berkeley.EDU> Date: 29 Aug 90 17:53:17 GMT Sender: daemon@ucbvax.BERKELEY.EDU Reply-To: Mitch Bradley Organization: The Internet Lines: 45 > In the printing of Basis 12 that I have (August, 21), it says that the > above word is in the CORE and NON-PORTABLE wordset (sic)! Well, now we > have a standard way of making non-portable programs in any ANS Forth > compatible system. The usage of " (quote) when compiled into a definition is in the CORE wordset. Its usage outside of a definition (i.e. in interpret state) is non-portable. Here's how this came about: Prior to Basis 12, " was only defined in compile state. I proposed that it should also be defined in interpret state. This has implications for the persistance of the string storage, i.e. how long does the string last before it is overwritten. Put another way, how many string buffers are there, or how many times can you execute " in interpret state before one of the strings is lost. I proposed that the system guarantee that at least 2 string buffers of at least 80 characters each. Another solution is to store the strings in the dictionary and allot space for them, but a lot of people (myself included) do not like the idea of having dead strings filling up the dictionary. There was extensive discussion about this, and no consensus could be reached. However, it was generally agreed that systems ought to allow the use of " in interpret state, at least for the convenience of the user in constructing arguments to file words. The compromise solution was to retain the compilation semantics (portable, uncontroversial, unambiguous) in the CORE wordset, and to put the interpretation semantics (which are somewhat of a can of worms, but useful nevertheless) in the NON-PORTABLE wordset. It is generally the case (yes, we all can think of an exception, so spare us, okay?) that "canned" programs mostly need to compile strings rather than interpret them, so this compromise mostly works. The compromise was acceptable to me, since it sends a signal to implementors that " in interpret state is a good thing. I would have preferred more definite semantics, but it became clear that I had better take what I could get. Mitch