From: Thomas Enebo Date: 2008-02-16T05:20:05+09:00 Subject: Re: Proc#curry Thomas Enebo wrote: > Gregory Brown wrote: >> On Fri, Feb 15, 2008 at 1:33 PM, Phlip wrote: >> >>> Yukihiro Matsumoto wrote: >>> >>> > proc {|x, y, z| x + y + z }.curry >>> > >>> > returns the proc object equivalent to >>> > >>> > proc {|x| proc {|y| proc {|z| x + y + z } } } >>> > >>> > See? >>> >>> Uh, how do we call that? >>> >>> oookay - proc{...}.call(x).call(y).call(z) >>> >>> What problem does that solve? >>> >> >> this one: >> >> plus_five = proc { |x,y,z| x, y + z }.curry.call(2).call(3) >> >> plus_five[10] #=> 15 >> >> > Also in some languages the 2 + 3 can be optimized to only happen > once. Doesn't look like it will here though? Ignore the question part of that...I have a minor head code today :) -Tom