summaryrefslogtreecommitdiff
path: root/proc.c
diff options
context:
space:
mode:
Diffstat (limited to 'proc.c')
-rw-r--r--proc.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/proc.c b/proc.c
index 9502f98772..5612f95fac 100644
--- a/proc.c
+++ b/proc.c
@@ -622,18 +622,25 @@ rb_proc_call_with_block(VALUE self, int argc, VALUE *argv, VALUE pass_procval)
* arguments. A <code>proc</code> with no argument declarations
* is the same a block declaring <code>||</code> as its arguments.
*
- * Proc.new {}.arity #=> 0
- * Proc.new {||}.arity #=> 0
- * Proc.new {|a|}.arity #=> 1
- * Proc.new {|a,b|}.arity #=> 2
- * Proc.new {|a,b,c|}.arity #=> 3
- * Proc.new {|*a|}.arity #=> -1
- * Proc.new {|a,*b|}.arity #=> -2
- * Proc.new {|a,*b, c|}.arity #=> -3
- * lambda { |a = 0| }.arity #=> -1
- * lambda { |a, b = 0| }.arity #=> -2
- * lambda { |a, b = 0, c = 0| }.arity #=> -2
- * lambda { |(a, b), c = 0| }.arity #=> -2
+ * proc {}.arity #=> 0
+ * proc {||}.arity #=> 0
+ * proc {|a|}.arity #=> 1
+ * proc {|a,b|}.arity #=> 2
+ * proc {|a,b,c|}.arity #=> 3
+ * proc {|*a|}.arity #=> -1
+ * proc {|a,*b|}.arity #=> -2
+ * proc {|a,*b, c|}.arity #=> -3
+ *
+ * proc { |x = 0| }.arity #=> 0
+ * lambda { |a = 0| }.arity #=> -1
+ * proc { |x=0, y| }.arity #=> 0
+ * lambda { |x=0, y| }.arity #=> -2
+ * proc { |x=0, y=0| }.arity #=> 0
+ * lambda { |x=0, y=0| }.arity #=> -1
+ * proc { |x, y=0| }.arity #=> 1
+ * lambda { |x, y=0| }.arity #=> -2
+ * proc { |(x, y), z=0| }.arity #=> 1
+ * lambda { |(x, y), z=0| }.arity #=> -2
*/
static VALUE