Skip to content

Instantly share code, notes, and snippets.

@AlexBaranosky
Last active August 29, 2015 13:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlexBaranosky/9948888 to your computer and use it in GitHub Desktop.
Save AlexBaranosky/9948888 to your computer and use it in GitHub Desktop.
interesting destructuring behavior I never took advantage of...
;; interesting destructuring behavior I never took advantage of...
;; Wonder if it'd make destructuring faster to remove the seq?
;; checking stuff, which I did know anyone used, at least not explicitly
;; macroexpand:
(let [{:keys [a b] :as c} '(:a 1 :b 2) ] [a b c])
;; =>
(let*
[map__27061
'(:a 1 :b 2)
map__27061
(if (clojure.core/seq? map__27061)
(clojure.lang.PersistentHashMap/create
(clojure.core/seq map__27061))
map__27061)
c
map__27061
b
(clojure.core/get map__27061 :b)
a
(clojure.core/get map__27061 :a)]
[a b c])
(let [{:keys [a b] :as c} '(:a 1 :b 2) ] [a b c])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment