Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
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 having an uproarious good time at the Monastery: (9)
As of 2014-10-20 10:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (75 votes), past polls