clojure - Is there an if-clojurescript macro? -
is there macro clojure , clojurescript allow insert different expressions depending on whether file being compiled in clojure or clojurescript?
(if-clojurescript (my clojurescript definition) (my clojure definition)) essentially i'm looking #ifdef some_platform macros might see sprinkled around c++ code. think useful files part of cross-over, 1 small part of file isn't compatible between clojure/clojure-script.
this new feature clojure 1.7 : reader conditionals.
also see daniel compton blog, example :
#?(:clj (clojure expression) :cljs (clojurescript expression) :clr (clojure clr expression)) you may want @ macrovitch.
Comments
Post a Comment