2010/6/3 Meikel Brandmeyer <m...@kotka.de>

> Hi,
>
> Am 03.06.2010 um 16:16 schrieb Laurent PETIT:
>
> > I think I clearly understand the benefits of namespaces in this case. I
> was reacting to Meikel's sentence:
> >
> > "And redefining things in foreign namespaces is rather not a technique we
> should support..."
>
> I think what I meant was mentioned also by the others: don't extend a
> protocol to a type if you don't own either one. Doing so if you don't own
> one of them, this is basically equivalent to
>
> (in-ns 'some.other.namespace)
>
> (let [orig-x some-x]
>  (defn some-x
>    [foo]
>    (if (my-foo? foo)
>      (do-stuff foo)
>      (orig-x foo))))
>
>
Sorry Meikel, but I'm having trouble following you today.
Does the above example stand for "pseudo-code" for explaining what happens
when one reimplements a protocol (in which case I'm pretty sure you're wrong
- redefining a protocol extension on a type redefines it for all following
calls, from any thread), or does the above example stand for pseudo-code for
how one would "try" to "break the rule" (mentioned by Christophe, Rich, and
others) in a (hopefully) non-intrusive way ?

-- 
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

Reply via email to