On Mar 24, 9:00 am, Josh Grams <j...@[EMAIL PROTECTED]
> wrote:
> I think you need to compile to a temporary buffer if you're going to
> execute and discard it. e.g. what if the code adds stuff to the
> dictionary?
But that is normal, so you design it so it causes no problems.
This is also more of why there is a natural fit between line at a time
and compile always.
You compile a line into a temporary buffer for each line, and then if
the compilation hits a a defining word, it does whatever it does as
far as setting up a header (or not), sets the compilation pointer if
its zero, and compilation continues. If the compilation pointer is non-
zero when compilation is finished, the buffer is copied to the
dictionary, starting from the compilation point, a return patched into
the compilation point, and the buffer is executed.
You specify an immediate word when you compile, maybe ``[:]'', and it
is entered into a wordset of immediate words. The compiler searches
the immediate wordlist first, executing if found, then the normal
wordlist, compiling if found. That means that the anchor for the
wordlist can contain the execution token for what is done when a word
is found in the list, and that the top three (or more, if the name
length is smaller than 31) bits are free for some other purpose ... or
for being reset, if the system supports an extended counted string
that uses the top three bits to indicate how many additional octets
are in the count.


|