Coos Haak <
htr...@gmail.com> writes:
>Op Sun, 14 Jan 2018 07:42:03 GMT schreef Anton Ertl:
[fig-Forth TRAVERSE bit]
>> In fig-Forth this system allowed
>> to keep only the first few letters of each word, but if we keep all
>> letters, we can use the length count to traverse the name in one
>> direction; and only one direction is necessary.
>>
>> - anton
>
>No, earlier versions like Polyforth used three letter words to save
>space. Figforth kept all the letters and therefore TRAVERSE was invented.
You probably mean microForth, not polyForth. Yes, Forth, Inc.'s
earlier Forths had the three-char+length scheme to save space. And
later systems kept all chars, so the length information could be used
to traverse the name. fig-Forth, however, took an in-between
position: It had a usewr variable WIDTH that specified the stored
length of the name on creation. By default WIDTH was 31, and all
chars were kept, but you could, e.g., set it to 3 to get
microForth-like storage efficiency. Because the WIDTH was evaluated
at CREATE time, different words could have different stored lengths.
As a result, you could not use the length of the name to traverse it,
and they used the high bit to provide that additional information.
Of course with the spread of 8-bit encodings such as Latin-1 in the
1980s, and UTF-8 since 1994, this is not viable any more (and using
UTF-7 would pile another idiocy on top), and memory is not so scarce
that we need WIDTH any more (the fact that you forgot about WIDTH
shows that it was hardly used alreade in the heyday of fig-Forth),
that's why no Forth system that I have tested in this century uses the
high bit in the fig-Forth way.