The message below is being cross-posted from the LogoForum. Please
reply here at comp.lang.logo and it will be cross-posted back to the
LogoForum. The original author of this message is
tomcsanyi@[EMAIL PROTECTED]
12:13 25.1.2008, Peter Tomcsanyi wrote:
>At 11:29 25.1.2008, Pavel Boytchev wrote:
> >Bertrand Carette wrote:
> > > The question is : does any Logo implement *tail recursion *?
> and why not ?
Here is one correction to my previous post on this topic:
In my text I made one typo, which may make my idea unreadable, so
here is the correction of the whole paragraph (the corrected word in
UPPERCASE):
Among other reasons, why I did not implement it is the fact that the
more experiences on real usage of Logo I gain the more I think that
simple things should be done ITERATIVELY and that nearly all the
stunning uses of recursion (where it has really sense and is not only
an exercise to do simple things in a more complicated way) are
non-tail ones. But maybe once I will try to implement it.
---
And one addition:
The other direction of complications for tail recursion handling is
not only its detection but also its handling. It is easy for
parameterless procedures, but becomes more complex with parameters
and local variables because of dynamic scope, which enables the
called procedure to use variables of the caller. So the variables of
the caller must exist during the execution of the tail call even if
the return address is not needed anymore (but we must arrange it
without exhausting the stack).
Peter
__._,_.___
LogoForum messages are archived at:
http://groups.yahoo.com/group/LogoForum