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

2020-08-12 Thread Alan Thompson
I verified the problem in the StackOverflow post. For some reason keyword lookup of record fields in CLJS doesn't work. Alan On Tue, Aug 4, 2020 at 12:05 PM Justin Smith wrote: > I don't think this is true, or if true is incidental to the real problem > > % cljs > ClojureScript 1.10.758 >

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

2020-08-04 Thread Justin Smith
I don't think this is true, or if true is incidental to the real problem % cljs ClojureScript 1.10.758 cljs.user=> (defrecord Attr [has-default default]) cljs.user/Attr cljs.user=> (get (->Attr true 1) :default) 1 cljs.user=> (:default (->Attr true 1)) nil cljs.user=> On Tue, Aug 4, 2020 at

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

2020-08-04 Thread Mark Engelberg
You misspelled default in your defrecord. On Tue, Aug 4, 2020 at 7:42 AM 'clartaq' via Clojure < clojure@googlegroups.com> wrote: > I originally posted > > this on

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

2020-08-04 Thread 'clartaq' via Clojure
I originally posted this on StackOverflow. When I try this: ```clojure (defrecord Attr [has-default default]) (def attr (->Attr true 1)) (get attr :default) ;;=> 1