Welcome! Please see the About page for a little more info on how this works.

0 votes
in ClojureScript by

In clojurescript, I have a data reader that returns a record from a tagged literal:

(ns x.x)

(defrecord X [y])

(defn make-x [y] (->X y))

data_readers.cljc:

{x x.x/make-x}

This doesn't work correctly inside of go blocks:

(println "outside of go:" #x"a")
(go
  (println "inside of go:" (<! (go #x"b"))))

Results in:

outside of go: #x.x.X{:y a}
inside of go: {:y b}

@hiredman on the clojurians slack pointed out the issue:

what is happening is here
https://github.com/clojure/core.async/blob/master/src/main/clojure/cljs/core/async/impl/ioc_macros.clj#L403

map? is returning true so it is compiling your record as a map

1 Answer

+1 vote
by
...