From: grady@... (Steven Grady) Date: 2000-12-01T03:40:03+09:00 Subject: [ruby-talk:6682] behavior of Proc#arity? I was looking at the library reference, and I have to say I'm confused about the behavior of Proc#arity. First, note that the reference is now wrong. It says that Proc.new {|a|}.arity returns -2, when it has been fixed (?) to return -1. So given that, why do all the following argument specifiers: || |a| |*a| return -1, while there is nothing that returns 0 or 1? Following the POLS, I would have expected: 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 Doesn't this make more sense? BTW, as far as I can tell, nothing currently uses "arity", so if this were a reasonable change, there shouldn't be any real problems with backwards-compatibility.. -- Steven "Mind your manners, son! I've got a tall pointy hat!"