Re: The IMMEDIATE mess
- From: "GerryJ" <gerry@xxxxxxxxxxxxxxxxxxxxxxx>
- Date: 29 Aug 2006 10:11:14 -0700
Alex McDonald wrote:
<snip>
In a dual xt system, something like IF would work as follows;<snip>
: IF -14 throw compilation> ( xt of IF -- ) ... ; \ do IF when
compiling stuff
The part before compilation> is interpret time (and is the xt returned
by FIND), the part after is compile time. It's not immediate (it has
non-standard compilation semantics) and it's not state-smart either.
The outer interpreter is state smart, and has enough carnal knowledge
of the dual XT to know which half to execute. In this system, you can
count interpret, compilation and execution uses with (tested on an
experimental STC version of W32F that supports this)
That's more or less what my system does. Every word has a pointer to a
semantics class, which contains, amongst other things, two methods
called interpret() and
compile(). Each of these is defined with a :noname definition.
Therefore if::interpret() throws an exception, if::compile() does what
it should. The text interpreter calls interpret() or compile()
depending on the value of STATE or immediacy of the found word.
Perhaps I should make the semantics base class visible to the user, at
present it's hidden.
Gerry
.
- Follow-Ups:
- Re: The IMMEDIATE mess
- From: Andreas Kochenburger
- Re: The IMMEDIATE mess
- References:
- The IMMEDIATE mess
- From: J Thomas
- Re: The IMMEDIATE mess
- From: Julian V. Noble
- Re: The IMMEDIATE mess
- From: Alex McDonald
- The IMMEDIATE mess
- Prev by Date: Re: Case sensitivity
- Next by Date: Re: RfD - SYNONYM
- Previous by thread: Re: The IMMEDIATE mess
- Next by thread: Re: The IMMEDIATE mess
- Index(es):
Relevant Pages
|