Details
-
Type:
Defect
-
Status:
Closed
-
Priority:
Major
-
Resolution: Completed
-
Affects Version/s: Release 1.1, Release 1.2, Release 1.3, Release 1.4, Release 1.5
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Environment:This should happen on any system. I have tested it on macs in version 1.4 and 1.2.1
-
Patch:Code and Test
-
Approval:Ok
Description
The way destructuring happens should not be affected by the fact that I have the same w at two-levels.
user>> (let [{{a :a b :b :as w} :c a1 :a b1 :b :as w} {:a 10 :b 20 :c {:a 30 :b 40}}] {:a a :b b :b1 b1 :a1 a1})
{:a 30, :b 40, :b1 40, :a1 30} <- unexpected behaviour.....
user>> (let [{{a :a b :b :as w} :c a1 :a b1 :b :as w1} {:a 10 :b 20 :c {:a 30 :b 40}}] {:a a :b b :b1 b1 :a1 a1})
{:a 30, :b 40, :b1 20, :a1 10} <- expected behaviour ..
Even having the :as things from both should not affet how others are destructured.. The email thread talking about the same is here
https://groups.google.com/forum/?fromgroups#!topic/clojure/3z3JtXhcDB0
A less eye-bleeding example
(let [{{inner :a :as w} :c outer :a :as w} {:a 10 :c {:a 30}}] outer)(let [{{inner :a :as w} :c outer :a :as w} {:a 10 :c {:a 30}}] outer)