Show Navigation
Conversation
Notices
-
Here Chuck is talking about how he got tired of all the various loop construct and says that what he is doing today is just recurse into yourself if you need a loop.
What he is describing is basically a named let and a tail call. Very cool. The similarities, or maybe duality, of !scheme and !forth have never been more obvious.
> (Jeff) You might point out that your semicolon after WORD results in tail recursion and converting the call in WORD to a jump and that is how it functions.
> (Chuck) So there is no reason to make that a call since you are never going to go anywhere afterwards so you just make that jump. In fact in all my latest Forths semicolon kind of meant either return or jump depending on the context and it's optimized in the compiler to do that. It's a very simple look back optimization that actually saves a very important resource, the return stack.
http://www.ultratechnology.com/1xforth.htm