Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: [OT]: threading recursive subroutines.

by ikegami (Pope)
on Feb 02, 2011 at 19:58 UTC ( #885839=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub fibonacci {
       my ($n) = @_;
    ...
       return 1 if $n == 1;
       return sum fibonacci($n-2), fibonacci($n-1);
    }
    
  2. or download this
    sub fibonacci {
       my ($n) = @_;
    ...
          async { fibonacci($n-2) },
          async { fibonacci($n-1) };
    }
    
  3. or download this
    sub fibonacci {
       my ($n) = @_;
    ...
          async_maybe { fibonacci($n-2) },
          async_maybe { fibonacci($n-1) };
    }
    
  4. or download this
    sub fibonacci {
       my ($n) = @_;
    ...
       #      must call $on_complete->($x+$y).
    
    }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (9)
As of 2016-12-06 10:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (101 votes). Check out past polls.