Chaim Frenkel wrote:
>
> >>>>> "PC" == Piers Cawley <[EMAIL PROTECTED]> writes:
>
> PC> Chaim Frenkel <[EMAIL PROTECTED]> writes:
> >> Why would anyone want to select a different method based upon the
> >> arguments.
>
> PC> Have you seen Class::Multimethods? This kind of despatch can be very
> PC> useful. Of course, the existence of Class::Multimethods proves that it
> PC> can be done already so there may be no need to put it in the core.
>
> You answered the HOW, not the WHY.
>
> The question for the audience is WHY, I would want to do this.
>
> (As a counterpoint. Dr. Myers argues very strongly against this.)
>
There are a couple of reasons for overloading. simple arithmetic operations, you
can use plus(int, int), plus(float, float). another approach is to use
genericity like in eiffel, and the templates in C++, which is probably better in
the sense that you only have one function ie plus(<type>, <type>).
peter
--
"Speak loudly, and carry a beagle!" -- Charles Schulz