in reply to Tail recursion elimination

billh,
This really isn't elimination - it is an optimization. See Pure Perl tail call optimization for more details (specifically this authoratative answer concerning the stack).

Cheers - L~R

Replies are listed 'Best First'.
Re^2: Tail recursion elimination
by jdporter (Paladin) on Apr 29, 2006 at 23:26 UTC

    LR, you're being overly pedantic. Tail call elimination means tail call optimization, even if the words would lead one to suppose otherwise.

    We're building the house of the future together.
        jdporter
        Isn't that the same thing? in a stack discipline re-using a stack frame just means popping a frame and then pushing one.
        Bill H
        perl -e 'print sub { "Hello @{[shift]}!\n" }->("World")'
        Um, goto &SUB does create a new stack frame, but only after the old one is stripped off. (Shouldn't leak memory though.)
Re^2: Tail recursion elimination
by billh (Pilgrim) on Apr 29, 2006 at 14:31 UTC
    Thanks for the link!
    The topic has some history obviously.

    Update:
    "tail recursion elimination", yeah, I guess I kind of made that up, I meant something like "elimination of the stack overhead of tail recursion".

    Bill H
    perl -e 'print sub { "Hello @{[shift]}!\n" }->("World")'