Liste des Groupes | Revenir à cl forth |
Do you think that the Forth standard should recognize the classic single-xt approach as possible for implementing a standard Forth system?Given I prefer single-xt (currently), what I don't get is how for a dual-xt system you define a single word with two actions for interpret and compile. I don't see a word to distinguish between the two, except maybe IMMEDIATE.
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.
: s" ( "ccc" -- sd | )Do you define the same word twice, once for compile (immediate) and again for interpret (order of definitions should not be important). Example:
[char] " parse
state @ if postpone sliteral exit then
dup >r allocate throw tuck r@ move r>
; immediate
Les messages affichés proviennent d'usenet.