Store multifn in atom instead var
ClojureScript has a stripped-down implementation of vars and does not have the alter-var-root! function.
How to store multifn in atom like clojurescript does? https://github.com/clojure/clojurescript/blob/master/src/main/clojure/cljs/core.cljc#L2768
Or maybe just use mutable field?
For clojurescript support #20
Related: #52
It looks like ClojureScript stores the individual bits of a multimethod in atoms rather than the entire multimethod itself
https://github.com/clojure/clojurescript/blob/e8643ab1cbaae9b01d3ed306711883f6473115aa/src/main/clojure/cljs/core.cljc#L2791-L2798
I need to think about how we could do something like this without affecting programmatic/functional multimethod manipulation -- if you do something like this:
(m/defmulti mf ...)
(let [mf2 (m/add-primary-method mf ...)]
...)
mf2 should not affect mf at all -- sort of like how assoc doesn't mutate the original map. If we used atom(s) everywhere it would bust things (unless add-primary-method copied the existing atom(s) into new atom(s)... maybe that would work).
I think either way we can get away with storing the entire impl in a single atom rather than having several atoms.