Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Forth > Re: Is interpre...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 14 of 21 Topic 3960 of 4053
Post > Topic >>

Re: Is interpret/compile the wrong distinction?

by Bruce McFarling <agila61@[EMAIL PROTECTED] > Mar 24, 2008 at 08:21 AM

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.




 21 Posts in Topic:
Is interpret/compile the wrong distinction?
Josh Grams <josh@[EMAI  2008-03-23 14:50:35 
Re: Is interpret/compile the wrong distinction?
Elizabeth D Rather <er  2008-03-23 15:06:31 
Re: Is interpret/compile the wrong distinction?
Bruce McFarling <agila  2008-03-23 14:09:50 
Re: Is interpret/compile the wrong distinction?
Jonah Thomas <jethomas  2008-03-23 19:23:48 
Re: Is interpret/compile the wrong distinction?
pablo reda <pabloreda@  2008-03-23 16:50:53 
Re: Is interpret/compile the wrong distinction?
Albert van der Horst <  2008-03-24 03:20:31 
Re: Is interpret/compile the wrong distinction?
John Doty <jpd@[EMAIL   2008-03-23 22:18:20 
Re: Is interpret/compile the wrong distinction?
Albert van der Horst <  2008-03-24 15:07:47 
Re: Is interpret/compile the wrong distinction?
John Doty <jpd@[EMAIL   2008-03-24 12:36:00 
Re: Is interpret/compile the wrong distinction?
Josh Grams <josh@[EMAI  2008-03-24 01:11:03 
Re: Is interpret/compile the wrong distinction?
Bruce McFarling <agila  2008-03-23 19:34:40 
Re: Is interpret/compile the wrong distinction?
John Doty <jpd@[EMAIL   2008-03-23 22:48:04 
Re: Is interpret/compile the wrong distinction?
Bruce McFarling <agila  2008-03-24 00:06:20 
Re: Is interpret/compile the wrong distinction?
Bruce McFarling <agila  2008-03-24 08:21:38 
Re: Is interpret/compile the wrong distinction?
Bruce McFarling <agila  2008-03-24 09:21:32 
Re: Is interpret/compile the wrong distinction?
Jonah Thomas <jethomas  2008-03-23 20:08:31 
Re: Is interpret/compile the wrong distinction?
Jonah Thomas <jethomas  2008-03-23 22:16:20 
Re: Is interpret/compile the wrong distinction?
Josh Grams <josh@[EMAI  2008-03-24 13:00:48 
Re: Is interpret/compile the wrong distinction?
Jonah Thomas <jethomas  2008-03-24 09:36:52 
Re: Is interpret/compile the wrong distinction?
Albert van der Horst <  2008-03-24 15:40:20 
Re: Is interpret/compile the wrong distinction?
anton@[EMAIL PROTECTED]   2008-03-24 13:41:05 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri May 16 7:07:48 CDT 2008.