From: Marcin 'Qrczak' Kowalczyk Date: 2002-10-23T00:48:32+09:00 Subject: Re: adding overload to ruby Fri, 27 Sep 2002 01:35:16 +0900, Christoph pisze: > b) CLOS way - Use the lexicographic or similar order > (for example a mixture of path length + lexicographic order) > on the multi-dispatch argument types to determine the > best (closest) match. This is fairly unnatural imo. > > c) Determine if a ``most specific '' specialization on > argument type (+ self type) exists. In case of ambiguities > call a method like ambiguous_method_call . > (default action is to raise an Exception) . This is Cecil's > and Dylan's way I believe. > > d) (A combination of b & c). Similar to c) but instead of > raising an exception in the presence of ambiguities choose > the lexicographic largest (or largest in another > good total order) among the ``most specific type > specializations. What is the difference between d) and b)? I have never used CLOS but I believe I once reinvented its ordering. It never signals ambiguities and prefers matches with larger number of dispatched types, then compares lexicographically (an implementation can be much simpler than for the Cecil's way). Isn't it the only reasonable choice among those which don't signal ambiguities? -- __("< Marcin Kowalczyk \__/ qrczak@knm.org.pl ^^ http://qrnik.knm.org.pl/~qrczak/