This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-11-27
Channels
- # announcements (4)
- # beginners (41)
- # biff (8)
- # cider (14)
- # clj-kondo (5)
- # clojure (45)
- # clojure-brasil (1)
- # clojure-europe (20)
- # clojure-nl (1)
- # clojure-norway (30)
- # clojure-uk (10)
- # clojurescript (8)
- # cursive (25)
- # datomic (20)
- # emacs (11)
- # events (1)
- # hoplon (9)
- # humbleui (7)
- # hyperfiddle (6)
- # lsp (63)
- # matrix (1)
- # observability (20)
- # off-topic (36)
- # polylith (11)
- # re-frame (2)
- # releases (1)
- # rewrite-clj (6)
- # scittle (42)
- # sql (6)
- # squint (86)
- # tools-deps (9)
clj-kondo gives an error for the following destructuring 🙂
(let [{a :a
va a} ;; <<- Unresolved symbol: a [unresolved-symbol]
{:a "value-of-a"
"value-of-a" :b}]
va)
;; => :b
not sure how this relates to the ordering of maps? From the result of the macroexpand, it seems it does not depend on the ordering,
(let*
[map__155836
{:a "value-of-a", "value-of-a" :b}
map__155836
(if
(clojure.core/seq? map__155836)
(if
(clojure.core/next map__155836)
(clojure.lang.PersistentArrayMap/createAsIfByAssoc
(clojure.core/to-array map__155836))
(if
(clojure.core/seq map__155836)
(clojure.core/first map__155836)
clojure.lang.PersistentArrayMap/EMPTY))
map__155836)
a
(clojure.core/get map__155836 :a)
va
(clojure.core/get map__155836 a)]
va)
thanks @U04V15CAJ it indeed depends on the ordering!
(let [{va a
a :a}
{:a "value-of-a"
"value-of-a" :b}]
va) ;; => error
👍 1