On 5/29/07, Michael Hollins <mick / hollins.id.au> wrote:
> Ken Bloom wrote:
> >
> > class Proc
> >    def curry *curryargs
> >       lambda{|*args| self.call(*(curryargs+args))}
> >    end
> > end
> >
>
> Please excuse my being slow, but how exactly would I use the above?
>
>

add = proc {|x,y| x+y}
add_two = add.curry(2)
add_two[2] # => 4

-- 
Chris Carter
concentrationstudios.com
brynmawrcs.com