On 12 July 2010 10:44, Nicolas Oury <nicolas.o...@gmail.com> wrote:
> Is it what it is supposed to do?

I think so.

The reason why this happens is that the Var backing the protocol holds
an immutable map, which extend modifies with alter-var-root; the copy
has the old version. You're able to add an implementation of the
protocol through the copy, because a "protocol descriptor" map holds a
reference to the protocol-backing Var; that is always the same Var
object, even if the value behind it changes, so this part of the copy
never becomes invalidated.

I also think that this is an implementation detail which shouldn't be
relied upon... A protocol defined in a namespace is, to me, a sort of
a permanent fixture in said namespace, so this doesn't bother me at
all.

Sincerely,
Michał

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