Meikel Brandmeyer (kotarak)
unread,Apr 19, 2012, 2:23:58 AM4/19/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to clo...@googlegroups.com
Hi,
I think this is a bug. This is the expansion without any :as clause:
(let*
[map__4496
{:a 10, :b 20, :c {:a 30, :b 40}}
map__4496
(if (clojure.core/seq? map__4496)
(clojure.core/apply clojure.core/hash-map map__4496)
map__4496)
map__4497
(clojure.core/get map__4496 :c)
map__4497
(if (clojure.core/seq? map__4497)
(clojure.core/apply clojure.core/hash-map map__4497)
map__4497)
a
(clojure.core/get map__4497 :a)
b
(clojure.core/get map__4497 :b)
a1
(clojure.core/get map__4496 :a)
b1
(clojure.core/get map__4496 :b)]
{:a a, :b b, :b1 b1, :a1 a1})
Now with the :as clauses:
(let*
[w
{:a 10, :b 20, :c {:a 30, :b 40}}
w
(if (clojure.core/seq? w)
(clojure.core/apply clojure.core/hash-map w)
w)
w
(clojure.core/get w :c)
w
(if (clojure.core/seq? w)
(clojure.core/apply clojure.core/hash-map w)
w)
a
(clojure.core/get w :a)
b
(clojure.core/get w :b)
a1
(clojure.core/get w :a)
b1
(clojure.core/get w :b)]
{:a a, :b b, :b1 b1, :a1 a1})
As you can see :as simply replace the generated symbol with the given one. This is a mistake however. I think the correct expansion should look something like this:
(let*
[map__4502
{:a 10, :b 20, :c {:a 30, :b 40}}
map__4502
(if (clojure.core/seq? map__4502)
(clojure.core/apply clojure.core/hash-map map__4502)
map__4502)
w map__4502
map__4503
(clojure.core/get map__4502 :c)
map__4503
(if (clojure.core/seq? map__4503)
(clojure.core/apply clojure.core/hash-map map__4503)
map__4503)
w map__4503
a
(clojure.core/get map__4503 :a)
b
(clojure.core/get map__4503 :b)
a1
(clojure.core/get map__4502 :a)
b1
(clojure.core/get map__4502 :b)]
{:a a, :b b, :b1 b1, :a1 a1})
Kind regards
Meikel