Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re: Perl6, Pugs and captures

by lidden (Curate)
on Mar 30, 2007 at 10:19 UTC ( [id://607427] : note . print w/replies, xml ) Need Help??

in reply to Perl6, Pugs and captures

Currying is when you take one function and make a new function by giving defaults to the first one. Here is an example in Perl 6 (please correct me if i got it wrong).
sub add(Num $x, Num $y){ $x + $y } &add_two := &add.assuming(y => 2); say add_two(1); # prints 3
Currying is in S06 and S03.