On Fri, Jul 08, 2005 at 02:14:27PM +0000, Luke Palmer wrote:
: Anyway, I think that once we start diving inside expressions to
: measure their specificity, we've gotten too complex to be predictable.

I would like to point out that for mere mortals, *any* MMD is already too
complex to be predictable.  Some people can't even predict SMD. :-/

Regardless of the MMD policy (or range of policies) we allow/enforce,
I think we need to consider what the naive user is to do in the face
of the (to them) black box of MMD.  I wonder if there's some way to
annotate a call to say exactly which routine you expect it to call, and
then if MMD dispatches elsewhere, you get some kind of a warning that
tells you exactly why it chose the other routine over your routine.
It doesn't have to dump the whole MMD decision tree on them, but
merely say something like "Argument $foo picked a constrained type
over an unconstrained type".  Or "Argument $bark picked Dog with
distance 1 over Mammal with distance 2".  Or "Argument $bark picked
'Dog where...' with distance 1-ε over Dog with distance 1".

Unless we can feed more specific information to the naive user
in an easily digestible form, I'm still inclined to say that *any*
constraint just subtracts "epsilon" from the distance, and if you don't
write your constraints to be mutually exclusive within a single file,
and you depend on the dispatch order to distinguish, it's erroneous.
(We could still subtract addtional values of epsilon for later files
to make Yuval happy--or at least less unhappy...)

Actually, a naive user probably doesn't even want to see the epsilons.
We could go as far as to make it:

    Argument $bark picked Dog where... with distance 0.99
                     over Dog          with distance 1

Then Yuval's overriding files can be distance 0.98, 0.97, 0.96, etc.
An epsilon of .01 should be small enough for anyone.  (Or at least
any engineer.)

The warner should also detect ambiguities in constraints if we make all
contraints in a file the same epsilon.  I just showed the warning for
a single argument, but it should probably tell the distance on all
the arguments that differ, and maybe even calculate the overall distance
for them.

Of course, if we make the MMD rules sufficiently complicated, we'll
just have to make the warning spit out a spreadsheet to show the
calculations.  Then we hide all that behind an interview process,
just like all our wonderful tax preparation software...

Larry

Reply via email to