On 17.06.2009, at 00:20, Chris Dean wrote: > To put it another way, why have the dichotomy between multimethods and > plain functions at all?
Performance is one reason, as has been discussed already. But for many of Clojure's plain functions, it is not clear what their dispatch function should be if they were to be converted to multimethods. As for the performance issue, Clojure is different from most other languages in that its built-in functions have no very special status: they are just the values of some vars in the namespace clojure.core. It is rather straightforward to define equivalent multimethods in some other namespace and use those instead. This leaves the programmer a choice between fast and flexible, which I think is very nice. I have written mutlimethod variants for some of Clojure's core functions; they are available in clojure.contrib.generic. More could be added of course. Konrad. --~--~---------~--~----~------------~-------~--~----~ 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 Note that posts from new members are moderated - please be patient with your first post. 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 -~----------~----~----~----~------~----~------~--~---