There are a few fundamental facts that shape my thinking on this question: 1) .clic files are the only place reader conditionals are allowed. [1]
2) When code is compiled using bootstrapped ClojureScript, the :cljs branch is always followed. 3) In bootstrapped ClojureScript, .cljc is used only as a fallback when .cljs and .clj files cannot be found for runtime and macro code respectively. [2] (I suspect this load ordering preference is also true for JVM ClojureScript.) So, the only places I think a single .cljc file can be used as the source of both runtime and macro code is regular JVM ClojureScript and regular Clojure. For JVM ClojureScript, I've referred to this "loading twice" as the "loop" pattern of arranging compilation stages [3]. And for Clojure, you can inherently freely intermix macros and functions in either .clj or .cljc files. I can't think of a way to do this with bootstrapped ClojureScript. For bootstrapped ClojureScript you could have any of these arrangements: Runtime Code Macro Code foo.cljs foo.clj foo.cljs foo.cljc foo.cljc foo.clj [1] http://clojure.org/reference/reader#_reader_conditionals [2] https://github.com/clojure/clojurescript/blob/r1.7.228/src/main/cljs/cljs/js.cljs#L59-L63 [3] http://blog.fikesfarm.com/posts/2015-12-18-clojurescript-macro-tower-and-loop.html -- Note that posts from new members are moderated - please be patient with your first post. --- You received this message because you are subscribed to the Google Groups "ClojureScript" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/clojurescript.
