Talk:Partial function application: Difference between revisions

Line 270:
main
</lang>
 
: With Ruby, you can also curry f2:
 
: <lang ruby>def f2(a, b, x)
a * x + b
end
 
u = method(:f2).to_proc.curry
v = u[7,9]
p [ (1..5).map {|x| u[7][9][x]}, (1..5).map {|x| v[x]} ]
# => "[[16, 23, 30, 37, 44], [16, 23, 30, 37, 44]]"</lang>
 
: I prefer a new task, not a change to this task. --[[User:Kernigh|Kernigh]] 00:25, 16 April 2011 (UTC)
Anonymous user