Source needs clojure/core.clj for some symbol (e.g.: when)
Closed this issue · 1 comments
arichiardi commented
After fixing #85 I noticed that some symbol includes clojure/core.clj
as :file
.
One of these symbols is when
, which currently does not work in our demos:
cljs.user=> (source when)
nil
On the contrary or
has cljs/core.cljs
in its :file
and therefore works as expected, because we have it in :src-paths
.
cljs.user=> (source or)
(core/defmacro or
"Evaluates exprs one at a time, from left to right. If a form
returns a logical true value, or returns that value and doesn't
evaluate any of the other expressions, otherwise it returns the
value of the last expression. (or) returns nil."
([] nil)
([x] x)
([x & next]
(core/let [forms (concat [x] next)]
(if (every? #(simple-test-expr? &env %)
(map #(cljs.analyzer/analyze &env %) forms))
(core/let [or-str (core/->> (repeat (count forms) "(~{})")
(interpose " || ")
(apply core/str))]
(bool-expr `(~'js* ~or-str ~@forms)))
`(let [or# ~x]
(if or# or# (or ~@next)))))))
This "bug" is related to #69 and explained also here and in the wiki.
arichiardi commented
The solution for this is to use https://github.com/Lambda-X/boot-pack-source.