clojurescript

ClojureScript, a dialect of Clojure that compiles to JavaScript http://clojurescript.org | Currently at 1.10.879
thheller 2021-06-02T06:48:58.471900Z

@haywood as Alex said. check the tools.reader version, not the cljs version

haywood 2021-06-02T15:08:29.479400Z

Not sure what :use-top means, but I assume it should all delegate to the 1.3.4 version below. How else can I debug? You wrote in a previous chat to start a clj repl and run “check `( "clojure/tools/reader__init.class")` to figure out the path of what is being used, but that doesn’t work for me, you did say “require it first” but I think that expression is missing a function in the archive?

clj -A:dev:test -Stree | grep tools.reader
    X org.clojure/tools.reader 1.0.0-beta1 :use-top
    X org.clojure/tools.reader 1.0.0-beta3 :use-top
    X org.clojure/tools.reader 1.3.2 :use-top
  X org.clojure/tools.reader 1.3.3 :use-top
      X org.clojure/tools.reader 1.3.2 :use-top
    X org.clojure/tools.reader 1.3.2 :use-top
        X org.clojure/tools.reader 0.7.2 :use-top
    X org.clojure/tools.reader 1.1.1 :excluded
      X org.clojure/tools.reader 1.1.1 :excluded
    X org.clojure/tools.reader 1.3.2 :excluded
    X org.clojure/tools.reader 1.3.2 :excluded
org.clojure/tools.reader 1.3.4
    X org.clojure/tools.reader 1.0.5 :use-top

thheller 2021-06-02T15:32:09.479700Z

yes, run shadow-cljs clj-repl then (<http://clojure.java.io/resource|clojure.java.io/resource> "clojure/tools/reader__init.class")

thheller 2021-06-02T15:32:26.479900Z

sometimes there are some bad AOT compiled versions on the classpath

haywood 2021-06-02T15:43:38.480100Z

I think that helped me solve the problem, yea it was using a version from a nested dependency that I was able to exclude from the package I depend on

haywood 2021-06-02T15:44:00.480300Z

that’s a great trick to figure it out 🙏:skin-tone-2: teach a man to fish etc etc. thank you

Pepijn de Vos 2021-06-02T09:04:08.472900Z

I forget, does clojurescript have an "explode" operator? Like I can use & to collect arguments but how do I uncollect them?

thheller 2021-06-02T09:05:08.473900Z

apply?

🎯 1
Pepijn de Vos 2021-06-02T09:05:40.474500Z

This is in the context of reagent in this particular case, it's warning me I should add keys to a list that is very much static, just because I passed children with & to a component.

thheller 2021-06-02T09:06:09.475100Z

into then

thheller 2021-06-02T09:06:24.475400Z

(into [:div] children) or (into [:&lt;&gt;] children) if you don't want the extra div

Pepijn de Vos 2021-06-02T09:09:29.477Z

Hmmmm alllmost what I want. Basically I want

(defn foo [&amp; args]
  (into [:div [:p "hi"]] args [:p "footer"]))

Pepijn de Vos 2021-06-02T09:10:07.477400Z

Gets a bit ugly if you first conj footer into args but I guess it'd work..

thheller 2021-06-02T09:10:41.477600Z

(defn foo [&amp; args]
  (-&gt; [:div [:p "hi"]]
      (into args)
      (conj [:p "footer"])))

👍 1
thheller 2021-06-02T09:11:24.477800Z

(defn foo [&amp; args]
  [:div
   [:p "hi"]
   (into [:&lt;&gt;] args)
   [:p "footer"]]))

thheller 2021-06-02T09:12:46.478300Z

plenty of ways to do this 😛

Pepijn de Vos 2021-06-02T09:14:14.478500Z

ohhh