summaryrefslogtreecommitdiff
path: root/proc.c
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2022-03-17 20:34:13 -0700
committerJeremy Evans <code@jeremyevans.net>2022-03-17 20:34:13 -0700
commit634e0a97eb82ab259c7f7a35d0486baebe77df0f (patch)
tree0935e059f1d710d1ee3d5e9a8b25b10882172057 /proc.c
parent2fdfd499db489db9eb4046849aa785c3bd382761 (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.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/proc.c b/proc.c
index 4a4ba70c87..faf3a5166e 100644
--- a/proc.c
+++ b/proc.c
@@ -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