On Mon, Oct 04, 2004 at 11:37:09PM +0900, Brian Candler wrote:
> >   case method(:ducky_method).arity
> >   when 5
> >   when 4
> >   when 3
> >   ...
> 
> Ugh... fortunately I've never had to write code like that :-) Especially
> with the nasty overloading of negative values: -3 means 2..infinity. (Or is
> it 4..infinity? I have to think about it every time. Remember, -1 means 0 to
> infinity, obviously. So -3 is 2 to infinity. Got that?)

Sorry, I will correct myself. -3 means at least 2, but the maximum limit is
not specified, and might be as low as 3.

  def foo(a,b,c=nil)
  end
  method(:foo).arity  # => -3

  def bar(a,b,c=nil,d=nil,e=nil)
  end
  method(:bar).arity  # => -3

It would be a nice use for ranges with infinite bounds, if they existed.

Regards,

Brian.