Talk About Network

Google


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: The word RE...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 6 of 8 Topic 3947 of 4287
Post > Topic >>

Re: The word RECURSE

by <Montesquiou> Mar 22, 2008 at 03:02 PM

"Anton Ertl" <anton@[EMAIL PROTECTED]
> a écrit dans le message de 
news: 2008Mar22.104825@[EMAIL PROTECTED]
> <Montesquiou> writes:
>>I am looking for a definition of RECURSE  in Forth-79.
>>My first try was
>>: RECURSE
>>         CONTEXT @[EMAIL PROTECTED]
 @[EMAIL PROTECTED]
 DUP
>
> Why CONTEXT?  I would rather expect CURRENT.
>
> Anyway, if your Forth has words like LATEST (or LAST) and NFA>,
> something like
>
> : recurse latest nfa> , ; immediate
>
> might work.  IIRC the classical definition of LATEST was:
>
> : latest current @[EMAIL PROTECTED]
 @[EMAIL PROTECTED]
 ;
>
> - anton

Great !

:  last current @[EMAIL PROTECTED]
 @[EMAIL PROTECTED]
 ;
: nfa> dup c@[EMAIL PROTECTED]
 1+  +   2+  ;
: recurse last nfa> ,  ; immediate
: factorial dup 1 > if dup 1 - recurse * then ;

It works fine ! Thank you, obrigado.


> -- 
> 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
 




 8 Posts in Topic:
The word RECURSE
<Montesquiou>   2008-03-22 09:42:49 
Re: The word RECURSE
mhx@[EMAIL PROTECTED] (M  2008-03-22 10:24:50 
Re: The word RECURSE
<Montesquiou>   2008-03-22 11:04:42 
Re: The word RECURSE
anton@[EMAIL PROTECTED]   2008-03-22 09:48:25 
Re: The word RECURSE
<Montesquiou>   2008-03-22 11:20:10 
Re: The word RECURSE
<Montesquiou>   2008-03-22 15:02:07 
Re: The word RECURSE
mhx@[EMAIL PROTECTED] (M  2008-03-22 16:02:57 
Re: The word RECURSE
<Montesquiou>   2008-03-22 18:47:50 

Post A Reply:
  Go here to Signup

AddThis Feed Button


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

Contact
tan12V112 Mon Oct 13 3:15:52 CDT 2008.