From: ts Date: 2001-05-14T23:13:43+09:00 Subject: [ruby-talk:15097] Re: [Q] Rroc#arity ambiguity. Is it a bug? >>>>> "L" == Leo writes: >> From the principle of least surprise I would expect that Proc.new{ |x| }.arity L> returns +1 because it has one required argument and no optional arguments. Try this : pigeon% ruby -e 'p (Proc.new{ |x,| }.arity)' 1 pigeon% pigeon% ruby -e 'a = Proc.new {|x,| p x} ; a[1] ; a[1, 2]' 1 -e:1: wrong # of arguments (2 for 1) (ArgumentError) from -e:1:in `[]' from -e:1 pigeon% pigeon% ruby -e 'a = Proc.new {|x| p x} ; a[1] ; a[1, 2]' 1 [1, 2] pigeon% Guy Decoux