clojurescript 2026-06-03

how do i do (.-message e) but with a variable field name? the equivalent to e[foo]?

i've always just used goog.object/get or goog.object/getValueByKeys

👍 1

https://clojurescript.org/news/2017-07-14-checked-array-access this is about arrays but has a section for field access

Nowadays I use unchecked-get.

👍 1

that whole page needs to be somewhere other than the news lol

It doesn't look like unchecked-get is documented anywhere. Should we be using it?

It has a docstring that says INTERNAL. But I have no respect for that word and no sense of self-preservation.

😆 2

Also, it's been around for almost 9 years now (got renamed from unsafe-get at some point though). It's been suggested to people an uncountable number of times over the years. Sometimes with addenda like "the docstring should be updated" and "it should also get a function in addition to the macro".

I just started a thread about it over in #C07UQ678E.

You shouldn't have variable field access, this will make TypeScript users mad. (j/k)

😄 3