BL

( -- char )

char is the character value for a space.

See:

Rationale:

Because space is used throughout Forth as the standard delimiter, this word is the only way a program has to find and use the system value of "space". The value of a space character can not be obtained with CHAR, for instance.

Testing:

T{ BL -> 20 }T

ContributeContributions

BerndPaysanavatar of BerndPaysan ASCII version of BLSuggested reference implementation2015-11-27 19:14:22

$20 CONSTANT BL

GeraldWodniavatar of GeraldWodni 2015-11-27 19:18:57

If it is so somple to implement, should it really be in the standard?

BerndPaysanavatar of BerndPaysan 2015-11-27 19:22:55

BL is more readable than $20, just as CHAR * is more readable than 42.

AntonErtlavatar of AntonErtl 2015-12-04 17:07:31

But is it necessary to have BL in core?

The rationale is written for an encoding-independent standard, but the standard ('94 and 2012) specifies that we use ASCII-compatible encodings, so we actually do have a way to do without BL (not as readable, but still).

Reply

BerndPaysanavatar of BerndPaysan An exampleExample2015-11-29 23:58:06

SPACE is an obvious example of how to use BL:

: SPACE ( -- ) BL EMIT ;
Reply