Permalink
Browse files

destructure expands to keyword-lookup when a key is a keyword

  • Loading branch information...
1 parent 6506709 commit fa130144e4466472b45db2e393ca3c3704036174 @cgrand committed May 8, 2010
Showing with 5 additions and 4 deletions.
  1. +5 −4 src/clj/clojure/core.clj
@@ -3340,10 +3340,11 @@
(if (seq bes)
(let [bb (key (first bes))
bk (val (first bes))
- has-default (contains? defaults bb)]
- (recur (pb ret bb (if has-default
- (list `get gmap bk (defaults bb))
- (list `get gmap bk)))
+ args (when (contains? defaults bb)
+ (list (defaults bb))) ]
+ (recur (pb ret bb (if (keyword? bk)
+ (list* bk gmap args)
+ (list `get gmap args)))
(next bes)))
ret))))]
(cond

0 comments on commit fa13014

Please sign in to comment.