Hi, On Thu, Jun 03, 2010 at 01:56:36PM +0200, Laurent PETIT wrote:
> Now to clojure. I can see the same problem occur, while the article's author > claims that in clojure there's (almost) no problem anymore. > If several libraries, including my program, redefine blindlessly a protocol > implementation for the same type, then the "last to speak" wins. > So isn't the problem basically the same ? No. A protocol lives in a namespace. So its methods have to be unique only in the same namespace. Types and reify implement protocols (and their Java interface) at definition time. Later on only the extend version via a map works. So the object itself is not modified. Only the protocol functions know about these extensions. And due to they belonging to a namespace it is clear what has to be called by the protocol method you call. And redefining things in foreign namespaces is rather not a technique we should support... Eh? Does that make sense? Sincerely Meikel -- 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