2 ms·
The idea that different methods can have the same name but different signatures presents many challenges. IMO, if you are going to live with the drawbacks, you
by raganwald 19y ago
The idea that different methods can have the same name but different signatures presents many challenges. IMO, if you are going to live with the drawbacks, you ought to be able to enjoy all of the benefits, such as you will find in full-features MOPs like in Common Lisp or pattern-matching languages like Haskell.
BTW, Ruby and Java both solve this problem. In Java, use the @override annotation. If you are not overriding a method, you get a compiler error.
Ruby "solves" the problem by only having one method per name. But you can mix in some magic and get pattern matching if you want.