From aedb7235f9bfba7402144a3b576c817d46f23ad3 Mon Sep 17 00:00:00 2001 From: Nathan Marz Date: Mon, 13 Jun 2016 17:25:29 -0400 Subject: [PATCH] add note on implementation detail of using cljs.analyzer --- src/clj/com/rpl/specter/macros.clj | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/clj/com/rpl/specter/macros.clj b/src/clj/com/rpl/specter/macros.clj index 7174d72..9fe52d3 100644 --- a/src/clj/com/rpl/specter/macros.clj +++ b/src/clj/com/rpl/specter/macros.clj @@ -447,6 +447,9 @@ (defn cljs-macroexpand [env form] (require 'cljs.analyzer) + ;; need to get the expansion function like this so that + ;; this code compiles in a clojure environment where cljs.analyzer + ;; namespace does not exist (let [expand-fn (eval 'cljs.analyzer/macroexpand-1) mform (expand-fn env form)] (cond (identical? form mform) mform