On 31.03.2009, at 21:48, Konrad Hinsen wrote: > On 31.03.2009, at 18:50, Mark Engelberg wrote: > >> On Tue, Mar 31, 2009 at 9:45 AM, Konrad Hinsen >> <[email protected]> wrote: >>> I think this should be sufficient to cover all cases you mentioned, >>> but of course it needs to be tried in practice. >> >> I think your idea of specifying a sequence of items to try in the >> dispatching function, at the point of definition for the multimethod, >> violates the principle of allowing library consumers to easily extend >> this on their own without having to contact the library designer. > > Maybe I wasn't clear about one point: the return sequence is not the > sequence of concrete implementations to try (the dispatch function > wouldn't even necessarily know them), but a sequence of starting > points in the hierarchy from which the standard lookup would start.
One night's sleep later, I see that this is not sufficient. The dispatch function is defined before the multimethod, and thus potentially inside some library, which cannot know all the needs of its potential clients. So yes, there has to be a way to specify preferences later on. One possibility would be to make the dispatch function itself a multimethod, or have it call one, but I am not sure that's a good solution. Konrad. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---
