Comment made by: baritonehands
Hmm, I cloned but it won't let me edit.
So the documentation for alter-meta! states that it is supported for Vars:
"Atomically sets the metadata for a namespace/var/ref/agent/atom to be:
(apply f its-current-meta args)
f must be free of side-effects"
But it doesn't work and after looking at the source, the only thing needed to support Vars is to remove the _ from _meta
:
(defn alter-meta!
(link: iref f & args)
(set! (.-meta iref) (apply f (.-meta iref) args)))
(deftype Var (link: val sym meta)
...
IMeta
(-meta (link: ) _meta)
...