Skip to content

Instantly share code, notes, and snippets.

@aamedina
Created December 12, 2014 02:53
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 aamedina/542b084d31d4e0c9a7a8 to your computer and use it in GitHub Desktop.
Save aamedina/542b084d31d4e0c9a7a8 to your computer and use it in GitHub Desktop.
(macroexpand '(let [{:keys [bar foo]
:or {foo 1
bar (inc foo)}} {}]
(assert (= foo 1))
(assert (= bar 2)))
=>
(let* [map__2904 {}
map__2904 (if (clojure.core/seq? map__2904)
(clojure.lang.PersistentHashMap/create (clojure.core/seq map__2904)) map__2904)
foo (clojure.core/get map__2904 :foo 1)
bar (clojure.core/get map__2904 :bar (inc foo))]
(assert (= foo 1)) (assert (= bar 2)))
(macroexpand '(let [{:keys [foo bar]
:or {foo 1
bar (inc foo)}} {}])
=>
(let* [map__2907 {}
map__2907 (if (clojure.core/seq? map__2907)
(clojure.lang.PersistentHashMap/create (clojure.core/seq map__2907)) map__2907)
bar (clojure.core/get map__2907 :bar (inc foo))
foo (clojure.core/get map__2907 :foo 1)])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment