On 3/10/12 4:28 PM, BruceMcF wrote:
> On Mar 10, 8:19 pm, "Rod Pemberton"<do_not_h...@noavailemail.cmm>
> wrote:
>> I've got the same question as this guy:
http://groups.google.com/group/net.lang.forth/msg/918a69f68bc22d04
>>
>> I just got around to implementing compile behavior for ' (tick).
>> Of course, testing tick's compile behavior against a few ANS Forths
>> confirmed that ' (tick) is not useable for ANS in a colon-definition,
>> i.e., I should've been using ['] not ' .
>
> ' is certainly quite useable in a colon definition, if you want to get
> the xt from a string in the current input that you know is going to be
> the name of a word.
>
> Making it state smart would interfere with that use.
Exactly.
>> Apparently, F83 split ' (tick) into ' (tick) interactive
>> and ['] (bracket-tick) compile-only. There doesn't seem to be an
>> explanation in the F83 specification. Why?
>
> Could be following some Forth system of the time that did it that way.
> Someone who used polyForth back in the day could say whether polyForth
> did it that way. Or some other variety ~ Forth79 may have been labeled
> a standard but it ended up just being one more variety of Forth.
polyFORTH (and FORTH, Inc. systems dating back before polyFORTH) have
never favored "state-smartness". In the early days, FIG developers (most
of whom were more interested in developing Forth than in using it to
write applications) were quite keen on state-smart words. This was one
of several major points of disagreement between FIG and FORTH, Inc.,
which was using Forth in major applications routinely, as were our
customers.
By the early 80's, there were a number of other independent Forth
vendors, and a lot more people using Forth in applications. In one of
the two meetings in 1982 that produced Forth83, the major players in
FIG, accompanied by several of these vendors, announced that they had
realized that state-smartness was not as useful as they had thought, and
backed the separation of functions that you see.
> The basic "why" would be because when you compile the interpreted
> version of ' its handy for it to be state-insensitive so that it works
> the same way if the word it is in is made immediate and used in
> compile state. Making ' state insensitive and splitting the special
> compiler behavior out as a separate word ['] untangles some of the
> tangles caused by a state-smart ' that tangles ' and ['] together.
Yes. The naming convention [<name>] meaning an immediate, compile-only
version of <name> was adopted then. The use of square brackets was
because ] and [ control STATE.
Incidentally, 'Forth83' is the name of the standard; F83 is the name of
a public-domain system (implementation) produced by Laxen, Perry, and
Harris that was promoted as being a Forth83-compatible replacement for
figForth. Although it improved on figForth in many respects, it wasn't
actually Forth83 compatible in a few areas. It's confusing to say 'F83'
when you mean the standard.
Cheers,
Elizabeth
--
==================================================
Elizabeth D. Rather (US & Canada) 800-55-FORTH
FORTH Inc.
+1 310.999.6784
5959 West Century Blvd. Suite 700
Los Angeles, CA 90045
http://www.forth.com
"Forth-based products and Services for real-time
applications since 1973."
==================================================