dxf
2024-03-19 00:48:49 UTC
...
At least in gforth, VARIABLEs are initialized to 0. That seems like a
good thing for implementations to do ingeneral.
That's something I'd do for VALUEs should I move to omit the numericAt least in gforth, VARIABLEs are initialized to 0. That seems like a
good thing for implementations to do ingeneral.
prefix at creation. By automatically initializing VALUEs with 0, I can
pretend - if only to myself - that VALUEs are different from VARIABLEs.
I don't know who first coined 'VALUE' but based on his 1984 handout:
https://pastebin.com/p5P5EVTm
Martin Tracy seems as good a suspect as any. Tracy promoted IS as
the mechanism for changing a VALUE. Why he didn't use TO is unclear.
Perhaps it was to avoid clashing with Bartholdi's TO which was aimed
squarely at VARIABLEs. Rather than Bartholdi's radical changing of
VARIABLE, Tracy introduced a new data type - that of VALUE.
Unlike Bartholdi's VARIABLE, Tracy's new data type had aspects more
in common with CONSTANT - namely supplying a value at definition time:
n VALUE name
And it's quite misleading. In a survey of my usage of VALUE I have
indeed used VALUE where a CONSTANT should have properly been used.
This was only discovered when I set about to investigate what would
be the impact of my omitting the numeric prefix at creation.
AFAICS Tracy made the correct choice of introducing a new data type
rather than trying to redefine VARIABLE. Where he got it wrong IMO,
is in making VALUE appear as a CONSTANT - something ANS went along
with, presumably as it was by then 'common practice'. While I don't
see Standard Forth changing it as it would literally break every
program written using VALUE, I have fewer such qualms besides which
a mistake is a mistake.