Newsgroups: comp.lang.dylan
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!howland.reston.ans.net!news.sprintlink.net!dorite!ts1-ind-23.iquest.net!user
From: fritza@iquest.net (Fritz Anderson)
Subject: Completeness of generic dispatch
Message-ID: <fritza-3103951505240001@ts1-ind-23.iquest.net>
Sender: news@dorite.use.com (News Admin)
Organization: Himself
Date: Fri, 31 Mar 1995 20:05:24 GMT
Lines: 34

I think I have a good idea of how methods are selected for a given set of
arguments, but don't ask me to study a large module and the applicability
section of the DIRM and reliably come up with a list.  This, of course, is
what sorted-applicable-methods() is for.

I can imagine explaining the generic dispatch mechanism, and being asked,
"You mean that, among dozens of methods in a generic, any one could be
most-applicable for a given combination of parameters; there could be
hundreds of different next-method chains, depending on the parameters; and
a large -- potentially huge -- subset of the possible parameter lists will
bring my program to a stop?  Sounds like a combinatorial explosion.  How
can I cope with all those possibilties?  Is there at least a way I can
look at that universe to make sure I don't have any obvious gaps?  Or am I
forced to test every possible combination and decide whether I like the
behavior in each of the thousands of cases?"

1)  I hope there's a fallacy in this argument.  If not, I hope there is a
not-too-crippling design discipline that quenches the explosion.  At the
very least I'd like to hear a convincing argument that a generic/class
design is sufficiently good if and only if an ambiguous dispatch is not
possible; where "sufficiently good" means something more than just
preventing nondispatch.

2)  My hypothetical interlocutor (take THAT, Bill Buckley!) would like to
visualize the ambiguous vs the unambiguous domain of a generic.  Given a
generic, can one represent the applicability tree?  In two dimensions?  I
fear not, but if I'm wrong, can a browser be made to do that?

-- 
Fritz Anderson         Indianapolis, Indiana   317-257-2227
fritza@well.sf.ca.us   fritza@iquest.net       WT9T
I've begun to suspect that large portions of the Universe -- possibly
including history itself -- do not properly reward fair play, and I tell
you I'm pretty worked up about it.
