Arup Rakshit wrote in post #1136253:
>
> Again exception -
>
> (arup~>Ruby)$ pry --simple-prompt
>>> p = proc { |a,*b,c| }
> => #<Proc:0x84f7704@(pry):1>
>>> l = lambda { |a,*b,c| }
> => #<Proc:0x84bbeac@(pry):2 (lambda)>
>>> l.arity
> => -3
>>> p.arity
> => -3
>>> def m(a,*b,c);end
> => nil
>>> method(:m).arity
> => -3

I don't know that that's an exception so much as an inconsistency in 
Proc.  but again, I don't know what Proc reports it arity the way it 
does in the first place.

It makes sense for the Lambda, because you need to provide values for a 
and c, so there are two mandatory parameters. ~2 = -3

  l = lambda{|a,*b,c| p a, b, c }
  l[1,2] #=> 1, [], 2

-- 
Posted via http://www.ruby-forum.com/.