Fork me on GitHub
#cljs-dev
<
2021-11-01
>
borkdude16:11:40

Does ClojureScript have a concept of round-tripping records like Clojure has?

(defrecord A [])
(??/read-string (pr-str (->A)))
or do you have to manually add reader functions to `(edn/read-string {...} ...)` if you wanted to do this? Note: I don't need this, I just want to know if it's supported or not, and what's the reasoning behind it.

thheller16:11:20

it does not. the reason is that there is no way to dynamically look up the classname of a record at runtime in :advanced

thheller16:11:36

clojure can just load the class or namespace by name

borkdude17:11:29

well, given that the class is AOT-ed or defined at the right time