/ bl-word /

BL WORD and the text interpreter


> 3.4  The Forth text interpreter
> Text interpretation (see 6.1.1360 EVALUATE and 6.1.2050 QUIT)
> shall repeat the following steps until either the parse area
> is empty or an ambiguous condition exists:
>   a) Skip leading spaces and parse a name (see 3.4.1);

> 3.4.1    Parsing
>  Delimiters
> If the delimiter is the space character, hex 20 (BL),
> control characters may be treated as delimiters.
> The set of conditions, if any, under which a "space" delimiter
> matches control characters is implementation defined.
> To skip leading delimiters is to pass by zero or more contiguous
> delimiters in the parse area before parsing.

> 6.1.2450   WORD                                          CORE
>     ( char "<chars>ccc<char>" -- c-addr )
> Skip leading delimiters.  Parse characters ccc delimited by char.  An
> ambiguous condition exists if the length of the parsed string is greater
> than the implementation-defined length of a counted string.
> c-addr is the address of a transient region containing the parsed word
> as a counted string.  If the parse area was empty or contained no
> characters other than the delimiter, the resulting string has a zero
> length.  A space, not included in the length, follows the string.  A
> program may replace characters within the string.
> Note: The requirement to follow the string with a space is obsolescent and is
> included as a concession to existing programs that use CONVERT.  A program
> shall not depend on the existence of the space.
> See: Other transient regions, 3.4.1 Parsing.

Now, nothing in the standard says that BL WORD and the text interpreter
should treat control characters in the same way!

It is very easy, too easy to forget about this and create a system
where tabs are treated as spaces except that [IF] looks for an [ELSE]
or [THEN] delimited by spaces and not tabs.

And the Technical Committee will not be responsible in bugs of
your system. This behaviour will be your design error. So watch out!

additional comment:

Len Zettel wrote on Fri, 26 Jul 2002 18:56:13 GMT
in the message <hXg09.297873$iB1.15267200@bin4.nnrp.aus1.giganews.com>:
> There is also
> --------------------------------------------------------------
> 11.3.6 Parsing
> When parsing from a text file using a space delimiter, control characters
> shall be treated the same as a space character.
> -----------------------------------------------------
> Mitch was quite firm about having that language.
>   -LenZ-

page written by:


generated Wed Jul 23 02:53:41 2003mlg