cljs-dev

ClojureScript compiler & std lib dev, https://clojurescript.org/community/dev
dnolen 2020-04-21T13:45:06.188200Z

@mfikes was there a specific reason the REPL doesn't print the version if it's synthetic?

mfikes 2020-04-21T13:45:45.188700Z

No real compelling reason. It could print the number if useful.

mfikes 2020-04-21T13:46:06.189100Z

It looks like 0.0.xyz which might be helpful

dnolen 2020-04-21T13:57:37.189400Z

fixed in master

dnolen 2020-04-21T13:57:46.189800Z

tools like Cursive uses this to detect the REPL type

dnolen 2020-04-21T13:58:11.190400Z

so might as always emit - I was actually scratching my head for long time wondering why sometimes Cursive would detect other times not

dnolen 2020-04-21T13:58:23.190700Z

the difference was ClojureScript git dep or not

frozar 2020-04-21T16:58:41.193Z

@dnolen Hi, I'm back about the cljs.analyzer.api/analyze-file failure on a file of the specter package. After a while, I'm able to propose you a synthetic example of the issue in the demo repo: https://github.com/frozar/cljdoc_specter_support The synthetic example is in essential.cljc:

(ns essential
  #?(:cljs (:require-macros
            [essential
              :refer
             [varialization]]))

  ;; The following line makes the difference. If this line is uncomment
  ;; the cljs.analyzer.api/analyze-file function will execute successfully
  ;; on essential.cljc
  ;; #?(:cljs (:use [cljs.core :only [coll?]]))
  )

#?(:clj
   (do
     (defmacro varialization
       [arg]
       `(var ~arg))
     ))

(defn simple []
  (varialization coll?))
With this file, you would get the weird message about the unresolvable coll? symbol. If you uncomment the (:use [cljs.core :only [coll?]]) header line, the analysis succeed. My interpretation is that, during the execution of analyze-file on essential.cljc, the environment doesn't involve the cljs.core namespace by default. So it doesn't find coll?. Questions: Is it true? If yes, is it intentional?

dnolen 2020-04-21T16:59:24.193300Z

@fabien.rozar intentional

dnolen 2020-04-21T16:59:41.193600Z

you need to analyze core first

frozar 2020-04-21T17:01:02.194600Z

Hummm, OK, so I should analyse the core to update my environment and send it to the analyzer-file function, this is it?

dnolen 2020-04-21T17:02:06.195400Z

I believe there's a with-core helper in the api

dnolen 2020-04-21T17:02:11.195600Z

look for that

frozar 2020-04-21T17:02:55.196200Z

Nice, thank you for your amazing reactivity 🙂