hiding "update-meta!" and, and calling it via var (thx @DomKM)
This commit is contained in:
parent
b07b29f028
commit
57b63ddcaa
1 changed files with 3 additions and 5 deletions
|
|
@ -59,9 +59,7 @@
|
|||
(reset! inst value)
|
||||
(alter-var-root var (constantly value))))
|
||||
|
||||
;; (!) TODO: this should be private (needs thinking)
|
||||
;; it is public now, can be called by "defstate" on macro expansion
|
||||
(defn update-meta! [path v]
|
||||
(defn- update-meta! [path v]
|
||||
(swap! meta-state assoc-in path v))
|
||||
|
||||
(defn- record! [state-name f done]
|
||||
|
|
@ -134,7 +132,7 @@
|
|||
resume (assoc :resume `(fn [] ~resume)))]
|
||||
`(do
|
||||
(def ~state (DerefableState. ~state-name))
|
||||
(update-meta! [~state-name] (assoc ~s-meta :inst (atom (NotStartedState. ~state-name))
|
||||
((var update-meta!) [~state-name] (assoc ~s-meta :inst (atom (NotStartedState. ~state-name))
|
||||
:var (var ~state)))
|
||||
(var ~state)))))
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue