Accessing Record fields with keywords in ClojureScript not working as in Clojure

Viewed 152

When I try this:

(defrecord Attr [has-default default])
(def attr (->Attr true 1))
(get attr :default) ;;=> 1
(:default attr) ;;=> ClojureScript returns nil, Clojure returns 1

Is the difference in behavior when using keyword access expected? I couldn't find anything about it in the [docs][1] on the differences between Clojure and ClojureScript.

Update 2020-08-04

Deleted. See next.

Update 2020-08-06

It has been pointed out that my previous update contained a spelling error that caused the problem. I have removed the update rather than leave it as a trap for future readers.

It does not change the original observations or the solution.



  [1]: https://www.clojurescript.org/about/differences#_data_structures
0 Answers
Related