develooper Front page | perl.perl5.porters | Postings from January 2008

Re: For 5.12: tail calls for methods

Thread Previous | Thread Next
Aristotle Pagaltzis
January 17, 2008 10:23
Re: For 5.12: tail calls for methods
Message ID:
* Stevan Little <> [2008-01-17 19:10]:
> Perhaps we not look at this a replacement for goto as much as
> just something to do automagically for recursion only.

And how do you want to detect that? And how would that apply to
more complex scenarios, eg. a mutually recursive pair of
functions? (To say nothing of real-world scenarios like language-
level recursive parsers where each recursion cycle may involve
a different set of functions.)

You’re going down the rat-hole that Yves thought he needed to
descend into.

No, the right way of going about this is to provide alternative
syntax that combines `goto &SUB` with putting things in `@_` such
that the result looks just like a regular call, except for the
new keyword or whichever syntax signifies the tail call.

Aristotle Pagaltzis // <>

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About