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: How does th...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 12 Topic 3967 of 4065
Post > Topic >>

Re: How does this Mini-OOF thing work, again?

by anton@[EMAIL PROTECTED] (Anton Ertl) Mar 24, 2008 at 09:00 PM

Bruce McFarling <agila61@[EMAIL PROTECTED]
> writes:
>DOES> ( ... o -- ... ) @[EMAIL PROTECTED]
 over @[EMAIL PROTECTED]
 + @[EMAIL PROTECTED]
 execute ;
>
>... it would seem that when it does the ``OVER'', there's nothing
>really on the stack, so its not surprising that it @[EMAIL PROTECTED]
's garbage.

The stack effect notation above indicates the overall stack effect of
words defined with METHOD; it does not reflect the stack effect of the
code after the DOES>.  The difference is that, before executing the
code the body address of the defined word is pushed on the stack.

So, with more stack comments, you get:

DOES> ( ... o -- ... ) ( o addr ) @[EMAIL PROTECTED]
 over @[EMAIL PROTECTED]
 + @[EMAIL PROTECTED]
 execute ;

and when the OVER executes, there are two items on the stack.

- anton
-- 
M. Anton Ertl  http://www.complang.tuwien.ac.at/anton/home.html
comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
     New standard: http://www.forth200x.org/forth200x.html
   EuroForth 2008:
http://www.complang.tuwien.ac.at/anton/euroforth/ef08.html




 12 Posts in Topic:
How does this Mini-OOF thing work, again?
Bruce McFarling <agila  2008-03-24 13:20:36 
Re: How does this Mini-OOF thing work, again?
anton@[EMAIL PROTECTED]   2008-03-24 21:00:03 
Re: How does this Mini-OOF thing work, again?
Bruce McFarling <agila  2008-03-24 14:16:09 
Re: How does this Mini-OOF thing work, again?
Bruce McFarling <agila  2008-03-24 14:17:07 
Re: How does this Mini-OOF thing work, again?
Bruce McFarling <agila  2008-03-24 14:23:58 
Re: How does this Mini-OOF thing work, again?
Bernd Paysan <bernd.pa  2008-03-24 22:40:16 
Re: How does this Mini-OOF thing work, again?
Gerry <gerry@[EMAIL PR  2008-03-24 14:39:35 
Re: How does this Mini-OOF thing work, again?
jacko <jackokring@[EMA  2008-03-24 15:16:15 
Re: How does this Mini-OOF thing work, again?
Bruce McFarling <agila  2008-03-24 15:17:13 
Re: How does this Mini-OOF thing work, again?
Gerry <gerry@[EMAIL PR  2008-03-25 02:36:34 
Re: How does this Mini-OOF thing work, again?
Bruce McFarling <agila  2008-03-25 09:33:52 
Re: How does this Mini-OOF thing work, again?
Bruce McFarling <agila  2008-03-25 11:05:42 

Post A Reply:
  Go here to Signup

AddThis Feed Button


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

Contact
tan12V112 Sat May 17 4:37:36 CDT 2008.