Skip to content

Instantly share code, notes, and snippets.

@sritchie sritchie/test.clj
Created Apr 7, 2015

What would you like to do?
(defn cljs-env?
"Take the &env from a macro, and tell whether we are expanding into
(boolean (:ns env)))
(defmacro if-cljs
"Return then if we are generating cljs code and else for Clojure code."
[then else]
(if (cljs-env? &env) then else))
(defmacro when-clj
[& forms]
(when-not (cljs-env? &env) `(do ~@forms)))
(defmacro when-cljs
[& forms]
(when (cljs-env? &env) `(do ~@forms)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.