"Dat Nguyen" <thucdat / hotmail.com> writes:

> def a(b)
> end
> 
> but the next question raised. I cannot override the above with:
> 
> def a(b, c)
> end
> 
> and expect:
> 
> a +1
>
> or
> 
> a? 2? 3
> 
> to work. The list of args is different. Why doesn't it work?

Because Ruby doesn't dispatch based on the number of arguments. For a
given receiver, there'll only ever be one method called 'a'.


Dave