[Python-Dev] Re: type categories
16 Aug 2002 15:11:45 +0100
Andrew Koenig <email@example.com> writes:
> David> Oh, easily solved: "in the face of ambiguity, refuse the
> David> temptation to guess". There should be a best match rule, and
> David> if there are two best matches, it's an error.
> In the ML example I showed earlier:
> fun len() = 0
> | len(h::t) = len(t) + 1
> ordering is crucial: As long as the argument is not empty, both cases
> match, so the language is defined to test the clauses in sequence.
> My intuition is that people will often want to define category tests
> to be done in a particular order. There is no problem with such ordering
> as long as all of the tests are specified together.
If multimethods make it into Python, I think (hope!) it's a safe bet
that they will look more like CLOS's multimethods than ML's pattern
ZAPHOD: You know what I'm thinking?
ZAPHOD: Neither do I. Frightening isn't it?
-- The Hitch-Hikers Guide to the Galaxy, Episode 11