Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
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 romping around the Monastery: (15)
As of 2015-07-06 20:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (83 votes), past polls