diff options
author | Jeremy Evans <[email protected]> | 2022-03-17 20:34:13 -0700 |
---|---|---|
committer | Jeremy Evans <[email protected]> | 2022-03-17 20:34:13 -0700 |
commit | 634e0a97eb82ab259c7f7a35d0486baebe77df0f (patch) | |
tree | 0935e059f1d710d1ee3d5e9a8b25b10882172057 /proc.c | |
parent | 2fdfd499db489db9eb4046849aa785c3bd382761 (diff) |
Encourage arity argument in Proc#curry documentation for procs with variable arguments
This uses similar language to that used in Method#curry.
Diffstat (limited to 'proc.c')
-rw-r--r-- | proc.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -3569,6 +3569,10 @@ curry(RB_BLOCK_CALL_FUNC_ARGLIST(_, args)) * proc and returns the result. Otherwise, returns another curried proc that * takes the rest of arguments. * + * The optional <i>arity</i> argument should be supplied when currying procs with + * variable arguments to determine how many arguments are needed before the proc is + * called. + * * b = proc {|x, y, z| (x||0) + (y||0) + (z||0) } * p b.curry[1][2][3] #=> 6 * p b.curry[1, 2][3, 4] #=> 6 |