Mark A. Biggar wrote:
To do multi method dispatch, you want to select the method that best matches the parameters in the call.

The fundamental flaw of metric mmd is that it trades degrees of
specificity. Consider the subtype chain E <: D <: C <: B <: A
where the rule is that having an E it is better handled by a
method dealing with a D than one dealing with an A. The same
is the case for having a D being better handled by a C than an
A method. Now consider a multi with the two signatures :(A,C,C)
and :(D,A,A) and a call with (E,D,D) that goes to :(D,A,A) since
7 < 8. But note that it handles the two Ds as As instead of Cs
as in single dispatch.

Dispatch has to go to the single most capable implementation
*not* to the least misfit! The call above has to be brought
to the attention of a programmer.

Regards, TSa.

"The unavoidable price of reliability is simplicity" -- C.A.R. Hoare
"Simplicity does not precede complexity, but follows it." -- A.J. Perlis
1 + 2 + 3 + 4 + ... = -1/12  -- Srinivasa Ramanujan

Reply via email to