Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Recurse using goto; Bug?

by wade (Pilgrim)
on Jul 18, 2008 at 21:14 UTC ( #698739=note: print w/ replies, xml ) Need Help??


in reply to Recurse using goto; Bug?

That's interesting. In neither place do I find a terminating condition for the recursion so, theoretically, they both should run forever.

I have a separate question -- if you're going to use tail-recursion, anyway, why don't you just use iteration? If I understand things, correctly, you can only do tail-recursion with the 'goto &label' method.

Update: I added some clarification.

--
Wade


Comment on Re: Recurse using goto; Bug?
Re^2: Recurse using goto; Bug?
by ikegami (Pope) on Jul 18, 2008 at 22:05 UTC

    The issue wasn't whether it will run forever or not, but whether it would run out of memory or not. The OP is of the opinion that the memory usage of both snippets should be constant, while it's only the case for the second snippet.

      You're absolutely right, of course. The two should be identical. As it is, one of the snippets is silly and the other is silly and sucks up all memory. I sit, corrected. 8o).

      --
      Wade

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://698739]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2014-07-31 00:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (241 votes), past polls