Sujet : Re: VALUE and TO implementation
De : mhx (at) *nospam* iae.nl (mhx)
Groupes : comp.lang.forthDate : 04. Aug 2024, 10:38:00
Autres entêtes
Organisation : novaBBS
Message-ID : <f8f93d61d204bdbb566e420c8cf53ee0@www.novabbs.com>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
User-Agent : Rocksolid Light
On Sun, 4 Aug 2024 8:05:03 +0000, Paul Rubin wrote:
[..] I've sometimes thought of a version
of VALUE that makes two separate words, for reading and writing the
value:
>
17 XVALUE foo
>
creates two words, "?foo" and "!foo". ?foo pushes the value from foo
(initially 17) onto the stack. !foo moves TOS to foo.
That would work too, but apart from messing up Forth's unspoken
formatting guidelines, the scheme becomes impractical when you want to
propel additional messages like +TO, -TO, 'OF (returns address of),
0TO or CLEAR, SIZEOF and /OF . In practice, the latter two are used
very infrequently.
-marcel