Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This effectively ran the following code: @proc_add = Proc.new {|x,y,z| (x||0) + (y||0) + (z||0) } tmp = @proc_add.curry(1)[1,2] tmp.curry(3)[3,4,5,6].should == 6 The optional argument to `Proc#curry` is the arity of the curried proc. In other words: if the curried proc gets called with at least 1 argument, which means the value of `tmp` in this example will be equal to `@proc_add[1,2]`, the result is an Integer and not a new proc object. The example with a lambda would raise the error in the `curry(1)[1,2]` part, so the second test was pretty much the same as the first test.
- Loading branch information