wsbusup4@rw5.urc.tue.nl (Jan Stout) (05/06/91)
The function of START:, as I do perceive, is to factor the naming process from the definition process, which will allow the creation of nameless definitions. In the rationale that accompanies START:, J Hopkins states: `... expert Forth programmers have exploited intimate knowledge of their systems to generate unnamed code fragments. Now this function has been named and can be used in a portable program' I'm not sure wheter this degree of portability is possible using START: on it's own. In fact, if we take a closer look at the example construct (CMD: ;CMD), supplied by JH, we find: : :CMD ( n -- ) START: ... ; : ;CMD ( -- ) POSTPONE EXIT POSTPONE [ ; IMMEDIATE Written this way, me must infer that the only actions necessary to conclude the START: are an EXIT and a [ (to enter interpretation state). However when we check ;'s definition, we find that besides performing EXIT and entering compilation state ; also ENDS THE CURRENT DEFINITION, which IMHO may be more than a NOOP. A LOCALs mechanism e.g. will require the addition of some extra memory recovering words to the definition of ;. I think the only way to hide this `intimate knowledge' (system dependency) is to add yet another word called ;END (or START; (*)) that will perform ;'s function without the name processing. Jan Stout, wsbusup4@urc.tue.nl (*) I'm not sure about the etymology of START: ; does START: mean we're STARTing a definition with the : as a mere Brodie-like syntax convention, suggesting high level Forth will follow, or should the : (colon) be emphasized, stressing the fact that START: is a part of :? In the first case I'd prefer ;END, whereas in the latter START; seems more appropriate.
Mitch.Bradley@ENG.SUN.COM (05/07/91)
> The function of START:, as I do perceive, is to factor > the naming process from the definition process, which will > allow the creation of nameless definitions. > ... > I'm not sure wheter this degree of portability is possible using > START: on it's own. > ... > I think the only way to hide this `intimate knowledge' (system dependency) > is to add yet another word called ;END (or START; (*)) that will perform > ;'s function without the name processing. At the emergency ANS Forth meeting last week, we voted to change START: so it is just like ":" without a name. The new version can be closed with ";" or ";CODE" . Thus, John Haye's example would now be written: : :CMD ( n -- w sys ) :NONAME ; : ;CMD ( n w sys -- ) POSTPONE ; ( n w ) SWAP CELLS CMD-TABLE + ! ; IMMEDIATE > (*) I'm not sure about the etymology of START: ; > ... As you can see in the above example, the name was changed to :NONAME Mitch.Bradley@Eng.Sun.COM