Currying: Difference between revisions

Content added Content deleted
(added Ol)
(Add PHP)
Line 1,321:
</pre>
<small>(Of course you would probably not have to try too much harder to make it say 2+2=5 instead.)</small>
 
=={{header|PHP}}==
<lang php><?php
 
function product_curryied($a)
{
return function($b) use($a) {
return $a * $b;
};
}
 
echo json_encode(array_map(product_curryied(7), [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]));</lang>
{{out}}<pre>[7,14,21,28,35,42,49,56,63,70]</pre>
 
=={{header|PicoLisp}}==