It seems to me that defmulti should create a new instance of MultiFn, 
initialized with the method tables from the existing MultiFn, if any.
Then alter-var-root to update the Var holding the MultiFn.

A possible problem is that a new dispatch function might be inconsistent 
with the existing keys and values in the method tables.
You can fix that, with some pain by hand, with remove-all-methods 
<https://clojure.github.io/clojure/clojure.core-api.html#clojure.core/remove-all-methods>,
 
or remove-method 
<https://clojure.github.io/clojure/clojure.core-api.html#clojure.core/remove-method>
.

In any case, I think this possible inconsistency is less likely a problem 
than similar issues that may arise from sharing the global hierarchy.


On Wednesday, September 5, 2012 at 10:15:13 AM UTC-7, red...@gmail.com 
wrote:
>
> if I recall, the current defonce like behavior of multimethods was a 
> response to the situation where if you have your multimethods split 
> across multiple files reloading the file with the defmulti in it would 
> re-def the multimethod with the new dispatch, but it would not have 
> any of the methods loaded from the other files. 
>
> oscillating between these poles at about 6.31139e7hz seems less than 
> ideal. 
>
> maybe defmethod could try and capture the ns a method is defined in, 
> and defmulti would try to force a reload? seems overly complicated for 
> core. 
>
>
>

-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to