Sujet : Re: single-xt approach in the standard
De : stephen (at) *nospam* vfxforth.com (Stephen Pelc)
Groupes : comp.lang.forthDate : 18. Sep 2024, 00:04:25
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vcd1tp$3nsk0$1@dont-email.me>
References : 1 2
User-Agent : Usenapp for MacOS
On 17 Sep 2024 at 21:12:08 CEST, "Anthony Howe" <
achowe@snert.com> wrote:
On 2024-09-17 06:54, 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.
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.
VFX Forth 64 is a single xt system (with sub-xts) . It manages to separate
compilation and interpret actions for a word cleanly. S" is defined as below:
: S" \ Comp: "ccc<quote>" -- ; Run: -- c-addr u 6.1.2165
\ *G Describe a string. Text is taken up to the next double-quote
\ ** character. The address and length of the string are returned.
[char] " parse >syspad
;
ndcs: ( -- ) discard-sinline compile (s") ", ;
NDCS: describes the non-default compilation sematics of the word. The
process of arriving at this model is described in several recent EuroForth
papers.
-- Stephen Pelc, stephen@vfxforth.comMicroProcessor Engineering, Ltd. - More Real, Less Time133 Hill Lane, Southampton SO15 5AF, Englandtel: +44 (0)78 0390 3612, +34 649 662 974http://www.mpeforth.com MPE website
http://www.vfxforth.com/downloads/VfxCommunity/ downloads