-
-
Save pjstadig/295d8825c13646b3e8ff to your computer and use it in GitHub Desktop.
Loop destructuring holds the head of a sequence
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
;;;; This | |
(loop [[chunk & chunks] (partition-all 10000 foo)] | |
(when (seq chunk) | |
(do-something chunk) | |
(recur chunks))) | |
;;;; Macro exapnds to this | |
(let [G__3399 (partition-all 10000 foo) | |
[chunk & chunks] G__3399] | |
(loop* [G__3399 G__3399] | |
(let [[chunk & chunks] G__3399] | |
(when (seq chunk) | |
(do-something chunk) | |
(recur chunks))))) | |
;;;; Which holds the head of the partition-all sequence |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment