Sujet : Re: single-xt approach in the standard
De : albert (at) *nospam* spenarnc.xs4all.nl
Groupes : comp.lang.forthDate : 17. Sep 2024, 16:18:25
Autres entêtes
Organisation : KPN B.V.
Message-ID : <nnd$500b0697$7d00dd8a@45f2718c0f647048>
References : 1 2
User-Agent : trn 4.0-test77 (Sep 1, 2010)
In article <1a3ebf77c1ed8926d455a268e1309fe0@
www.novabbs.com>,
mhx <
mhx@iae.nl> wrote:
On Tue, 17 Sep 2024 10:54:37 +0000, Ruvim wrote:
>
Do you think that the Forth standard should recognize the classic
single-xt approach as possible for implementing a standard Forth system?
>
The classic single-xt approach implies that only one execution token
(xt) is associated with a name token (nt), and only one name token is
associated with a word (a named Forth definition). And words whose
compilation semantics differ form default compilation semantics are
implemented as immediate words.
>
First define exactly the [new things] that can be done with an xt or an
nt.
>
What some of my customers tried is, by using standard words, associate
generated code sequences with an xt (nearly impossible), or infer an nt
from an xt (which is not 1-to-n [n>=3], and asymmetrical).
>
A limited/qualified guarantee for the nt-xt relationship can be useful.
Example: DEFER aa ' DROP IS aa allows to recover the nt "DROP" from
aa's DEFER@ and it is possible to disassemble linked lists of nt's.
My take is that per definition xt is a behaviour, and no name associated.
An empty nt (but this is a misnomer!) has no name, no behaviour, no data,
an empty link field, and as far as other fields are present, they are empty
too.
In this situation one can fill in the behaviour into an nt, assign a
name to it, or link it into a wordlist.
If you have an xt, the only thing to do is run it, i.e. execute.
There is no guarantee that there is name associated with it, that
it is part of wordlist, and the data is only accessible if it
is associated with a CREATEd word, which imply that it has a name.
A word aliased in another wordlist can have the same behaviour
exact same xt, not to speak from compile and interpret xt's.
No wonder people get confused.
>
-marcel
-- Temu exploits Christians: (Disclaimer, only 10 apostles)Last Supper Acrylic Suncatcher - 15Cm Round Stained Glass- Style WallArt For Home, Office And Garden Decor - Perfect For Windows, Bars,And Gifts For Friends Family And Colleagues.