Which piece of code do you think makes ClojureScript significant?

This is unfortunate yes but the technical reason for this is that ClojureScript cannot lookup classes dynamically at runtime. Therefore it cannot map the your.ns.Human symbol to the class. But in general records are not part of actual EDN so in a sense CLJS is correct.

Clojure 1.9.0
=> (require '[clojure.edn :as edn])
nil
user=> (edn/read-string "#cljs.user.Human{:name \"pankaj\", :age 33, :sex :M}\n")
RuntimeException No reader function for tag cljs.user.Human  clojure.lang.EdnReader$TaggedReader.readTagged (EdnReader.java:801)
;; which matches the CLJS error
Error: No reader function for tag cljs.user.Human.

clojure.core/read-string should not be used for reading EDN data since it is unsafe and can be used to eval things and other dangerous stuff.

1 Like