Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^4: recursive anonymous subroutines

by runrig (Abbot)
on Apr 11, 2006 at 23:26 UTC ( #542703=note: print w/replies, xml ) Need Help??


in reply to Re^3: recursive anonymous subroutines
in thread recursive anonymous subroutines

Just thought I'd point out that this is an interesting reinvention of a previous post (though with one less level into the call stack due to the goto). Compare:
# Your's: sub make_call { goto $_[0] } # Anonymonk's(slightly rearranged): sub Y { $_[0]->(@_) }
Update: Well, it's more the same if you change your call to:
make_call (sub { my $factor = $_[1]; return $factor > 1 ? $_[0]->($_[0], $factor-1) * $factor : 1; }, $_);

Replies are listed 'Best First'.
Re^5: recursive anonymous subroutines
by snoopy (Deacon) on Apr 18, 2006 at 00:58 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://542703]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (2)
As of 2016-12-03 08:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (52 votes). Check out past polls.