This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-05-28
Channels
- # beginners (67)
- # boot (31)
- # cider (1)
- # cljs-dev (12)
- # cljsjs (1)
- # cljsrn (23)
- # clojure (86)
- # clojure-russia (2)
- # clojure-spec (6)
- # clojure-uk (12)
- # clojurescript (171)
- # core-async (2)
- # core-matrix (1)
- # cursive (3)
- # events (1)
- # lumo (6)
- # off-topic (118)
- # om (51)
- # onyx (16)
- # perun (3)
- # re-frame (14)
- # reagent (19)
- # uncomplicate (5)
- # unrepl (6)
- # untangled (6)
I finally figured out why we needed to qualify
`any?
(https://github.com/clojure/clojurescript/commit/61805334a521df6b865650741046e29bfda35b72)
It turns out it is not related to self-host (syntax quote is not broken in self-host).
If you are using (JVM) ClojureScript 1.9.562 in a project that also specifies Clojure 1.8.0, then, in a macro namespace, without qualifying, it will expand using the macro namespace’s name, to cljs.spec.alpha/any?
(unless you perhaps have Tonsky’s clojure-future-spec
at play). This is because any?
doesn’t exist in Clojure 1.8.0. In short, without us qualifying that symbol, it would require ClojureScript 1.9.562 users to also use some pre-release version of Clojure 1.9.0 that includes that predicate (which I assume is not a requirement that ClojureScript wants to levy).(The above applies in the case that you are using the shipping clojurescript-1.9.562.jar
as apposed to cljs.jar
, which includes Clojure.)
@mfikes so why doesn't it work in self-hosted?
I thought we had the new predicates in cljs.core
@anmonteiro My guess is that the failure was related to Planck using JVM ClojureScript in an early part of its compilation. I haven't tracked down this to be absolutely sure. But, I did reproduce the issue described above using only JVM ClojureScript. (I changed it back to unqualified, built the ClojureScript JAR, and used it directly in a minimal JVM-based ClojureScript project specifying Clojure 1.8.0.)
So if you change Planck to use Clojure 1.9 it starts working?
I suspect that Planck is simply compiling the Planck namespaces to ClojureScript, which use fdef
, using JVM ClojureScript, at that point.
Hah. My understanding of the issue was wrong then. Thanks
It is definitely a new kind of failure mode, I don't recall us ever encountering before. 🙂
@anmonteiro Confirmed. If you set Planck to use Clojure 1.8.0, you get
WARNING: Use of undeclared Var cljs.spec.alpha/any? at line 34 src/planck/core.cljs
but with 1.9.0-alpha17, Planck's ClojureScript compiles.