Last active
August 29, 2015 13:58
-
-
Save AlexBaranosky/9948888 to your computer and use it in GitHub Desktop.
interesting destructuring behavior I never took advantage of...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; 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