8 ms·
I am looking at one of the examples: https://github.com/feature-macros/clojurescript/blob/feature-macros/feature-macros-demo/src/demo/util.clj https://github.c
by ICWiener 12y ago
I am looking at one of the examples:
https://github.com/feature-macros/clojurescript/blob/feature-macros/feature-macros-demo/src/demo/util.clj https://github.com/feature-macros/clojurescript/blob/feature...
But if I run Clojure on the JVM, the following fails:
(def host nil)
(defn foo [] (when (= :cljs host)
(gstring/format "something")))
... the error being that there is no "gstring" namespace.
Since the proposed solution with macros would produce such code (I am right?), how does it solve the issue of namespaces that only exist in a specific platform?
- michaniskin 12y agoI think the `case-host` macro is what you're looking for: https://github.com/feature-macros/clojurescript/blob/feature-macros/feature-macros-demo/boot-shim.clj#L13-L15 https://github.com/feature-macros/clojurescript/blob/feature...
- ICWiener 12y agoOk, thanks. So unlike Common Lisp, symbol resolution does not occur at read time.