Quote *ns* var in defstate macro to avoid aot compilation issues.
This commit is contained in:
parent
94d6d0188a
commit
fc62681570
1 changed files with 2 additions and 2 deletions
|
|
@ -136,7 +136,7 @@
|
||||||
(defmacro defstate [state & body]
|
(defmacro defstate [state & body]
|
||||||
(let [[state params] (macro/name-with-attributes state body)
|
(let [[state params] (macro/name-with-attributes state body)
|
||||||
{:keys [start stop] :as lifecycle} (apply hash-map params)
|
{:keys [start stop] :as lifecycle} (apply hash-map params)
|
||||||
state-name (with-ns *ns* state)
|
state-name `(with-ns ~*ns* state)
|
||||||
order (make-state-seq state-name)]
|
order (make-state-seq state-name)]
|
||||||
(validate lifecycle)
|
(validate lifecycle)
|
||||||
(let [s-meta (cond-> {:order order
|
(let [s-meta (cond-> {:order order
|
||||||
|
|
@ -151,7 +151,7 @@
|
||||||
|
|
||||||
#?(:clj
|
#?(:clj
|
||||||
(defmacro defstate! [state & {:keys [start! stop!]}]
|
(defmacro defstate! [state & {:keys [start! stop!]}]
|
||||||
(let [state-name (with-ns *ns* state)]
|
(let [state-name `(with-ns ~*ns* state)]
|
||||||
`(defstate ~state
|
`(defstate ~state
|
||||||
:start (~'let [~state (mount/current-state ~state-name)]
|
:start (~'let [~state (mount/current-state ~state-name)]
|
||||||
~start!)
|
~start!)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue