Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^2: Specializing Functions with Currying

by FoxtrotUniform (Prior)
on Aug 06, 2004 at 22:18 UTC ( #380752=note: print w/ replies, xml ) Need Help??


in reply to Re: Specializing Functions with Currying
in thread Specializing Functions with Currying

Fair enough. It's not the case that currying is equivalent to making a closure, though (currying is more specific), but that's a minor point. The idea here is to describe a way to avoid the parameter-handling that comes with general-purpose functions, with as little lookup fuss as possible.

More generally, I'm turning into a functional-programming evangelist, and since Perl makes it easy to use a lot of my favourite techniques I'm writing about them here. Go up a meta-level from my OP, and what I'm talking about is building functions on an ad-hoc basis (compare to the static "functions are global named objects and part of the design document" world of straight procedural programming). Whether you use literal subs or build higher order functions to do it is less important than being aware of the possibility.

--
F o x t r o t U n i f o r m
Found a typo in this node? /msg me
% man 3 strfry


Comment on Re^2: Specializing Functions with Currying
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2014-09-20 23:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (164 votes), past polls