From: "Chr. Rippel" Date: 2001-12-14T02:46:32+09:00 Subject: [ruby-talk:28441] Re: why is Proc's arity function so weird? > >From the Pickaxe book (online, since the printed version is wrong, as is > the online description of Proc#arity): > 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 Add this to your list Proc.new {||}.arity � 0 Proc.new {|a,|}.arity � 1 Proc.new {|a,b,|}.arity � 2 Proc.new {|a,b|}.arity � 2 Proc.new {|a,b,c,|}.arity � 3 Proc.new {|a,b,c|}.arity � 3 ...... Proc.new {|a|}.arity � -1 Proc.new {|*a|}.arity � -1 Proc.new {|a,*b|}.arity � -2 Proc.new {|a,b,*c|}.arity � -3 /Christoph