Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Specializing Functions with Currying

by FoxtrotUniform (Prior)
on Aug 06, 2004 at 00:42 UTC ( #380421=perlmeditation: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @test_data = (
        ['none', 'The quick brown '],
    ...
        ['bold', 'dog'], 
        ['none', '.']
    );
    
  2. or download this
    my %handlers = (
        'none' => sub {shift},
    ...
    
        return $handlers{'para'}->($text);
    }
    
  3. or download this
    sub wrap_with_html
    {
    ...
        'ital' => \&wrap_with_html('i',
        'para' => \&wrap_with_html('p',
    );
    
  4. or download this
    sub curry
    {
    ...
    my $plus_five = &curry(\&foo, 5);
    
    &$plus_five(3);
    
  5. or download this
    sub curry
    {
    ...
    );
    
    print &build_para(\@test_data);
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://380421]
Approved by elusion
Front-paged by broquaint
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (8)
As of 2014-12-28 05:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (178 votes), past polls