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

Re: For 5.12: tail calls for methods

Thread Previous | Thread Next
From:
Aristotle Pagaltzis
Date:
January 17, 2008 10:23
Subject:
Re: For 5.12: tail calls for methods
Message ID:
20080117182348.GP31127@klangraum
* Stevan Little <stevan.little@iinteractive.com> [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.

Regards,
-- 
Aristotle Pagaltzis // <http://plasmasturm.org/>

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About