On Mar 25, 4:13 am, Mark Engelberg <mark.engelb...@gmail.com> wrote: > On Wed, Mar 25, 2009 at 1:44 AM, Konrad Hinsen > > <konrad.hin...@laposte.net> wrote: > > Could you elaborate a bit on this? I haven't met any major obstacles > > with multimethods yet. The dispatch functions give quite a lot of > > flexibility in practice. In what situation did you find them > > inconvenient? [... good points snipped...] I agree with all the points you raise here. > 3. The dispatch mechanism requires a lot of explicit prefer-methods, > or else it may be hard to guarantee you won't get a run-time error > from a situation the dispatch system considers ambiguous. This also > makes code less extensible because to add a method, you must know > about all the other methods that have been implemented in order to > insert all the appropriate preferences. [...] > it seems like Clojure's multimethods are less > sophisticated than their CLOS/Dylan counterparts I dunno if I'd go that far. What I can say is that you don't need anything like prefer-method to prevent dispatching ambiguities in either CLOS or Dylan. The requirement to hand-tweak dispatching strikes me as particularly ugly. How can I design an extensible API on MutiFns? I have no idea. Defining a new method can introduce an ambiguity in dispatching that requires a prefer-method call to fix. When I'm implementing the library, that's just a minor annoyance, but when I contemplate delivering it to someone else for use and extension, it suddenly turns into a major headache. Users of that library can break existing code by defining new methods, because new methods may introduce dispatching ambiguities. In order to fix the breakage, they need to know the right prefer-method calls to make. That means they need to understand esoteric details of the library implementation for no good reason--for no reason at all, except that if they don't know them, they won't be able to make the right prefer- method calls. Yuck. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---