Beefy Boxes and Bandwidth Generously Provided by pair Networks BBQ
Perl: the Markov chain saw
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
The deeper issue that always comes up is that tail-recursion would make caller give very different results. Which is a lot of fun when you are trying to debug a complex call. (Carp depends on caller for its output.)

Another subtle change is different destruction mechanics. In order to do tail-recursion, you have to clean-up your current variables, etc. With reliable destruction mechanics, this may cause interesting surprises. For instance consider the technique at •Re: sub and anonymous sub. Or consider ReleaseAction. Their behaviour changes. It already changes with goto, but at least there is an easily explained cause for the change. If it is done behind the programmer's back, how do you address the confusion?

I should also note that writing recursive routines that automatically perform iteratively makes more sense in Scheme where function calls are very cheap. When they are relatively expensive (as they are in Perl), the coolness isn't quite as compelling...


In reply to Re: Re: Re: Re: Re: Pure Perl tail call optimization by tilly
in thread Pure Perl tail call optimization by pdcawley

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others musing on the Monastery: (9)
    As of 2014-04-17 23:17 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      April first is:







      Results (458 votes), past polls