Currying: Difference between revisions

→‎{{header|Perl 6}}: make work again
(GP)
(→‎{{header|Perl 6}}: make work again)
Line 307:
 
=={{header|Perl 6}}==
All callable objects have an "assuming" method that can do partial application of either positional or named arguments. Here we curry the built-in subtraction operator.
{{incorrect}}
All<lang callableperl6>my objects&negative have= a "&infix:<->.assuming" method.(0);
say negative 1;</lang>
<lang perl6>sub f($a, $b) { $a - $b }
say .(1) for &f.assuming(0), &f.assuming(*, 0)</lang>
{{out}}
<pre>-1</pre>
1</pre>
 
=={{header|Prolog}}==
Anonymous user