Beefy Boxes and Bandwidth Generously Provided by pair Networks Cowboy Neal with Hat
Syntactic Confectionery Delight
 
PerlMonks  

Double-curried goodness

by tmoertel (Chaplain)
on Aug 06, 2004 at 21:46 UTC ( #380738=note: print w/ replies, xml ) Need Help??


in reply to Specializing Functions with Currying

You could always take it one step further and curry the call to curry, eliminating further redundancy:

*wrap_with_tag = curry( \&curry, \&wrap_with_html ); my %handlers = ( 'none' => sub {shift}, 'bold' => wrap_with_tag('b'), 'ital' => wrap_with_tag('i'), 'para' => wrap_with_tag('p'), );


Comment on Double-curried goodness
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://380738]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (7)
As of 2014-04-20 14:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (485 votes), past polls