Welcome! Please see the About page for a little more info on how this works.

0 votes
in Collections by

When accidentally switching keyword and (previously undefined) symbol in map destructuring, an error is correctly thrown:

(let (link: {:b b} {:b 1}) b)

=> CompilerException java.lang.RuntimeException: Unable to resolve symbol: b in this context, compiling: (/tmp/form-init7939480206147277345.clj:1:1)

When the symbol ("a" used below) is defined, however, there is a more subtle error:

(def a 0)
(let (link: {:a a} {:a 1}) a)
=> nil

Expected: Destructuring should only accept the defined keywords :or, :keys, :as, :strs and :syms as keys in a destructuring map.

3 Answers

0 votes
by

Comment made by: michaelblume

This may be a duplicate of CLJ-1613

0 votes
by

Comment made by: claj

Michael, I do think this is a somewhat different problem.

0 votes
by
Reference: https://clojure.atlassian.net/browse/CLJ-1702 (reported by claj)
...