Last active
October 30, 2015 10:58
-
-
Save swr1bm86/83a3a197778dbd7311ca to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| (for [[x y] (map vector '(1 2 3) '(4 5 6))] | |
| (list x y)) | |
| => ((1 4) (2 5) (3 6)) | |
| (for [[x y] (map vector '(1 2 3) '(4 5 6) '(7 8 9))] | |
| (list x y)) | |
| => ((1 4) (2 5) (3 6)) | |
| (for [[x y z] (map vector '(1 2 3) '(4 5 6) '(7 8 9))] | |
| (list x y z)) | |
| => ((1 4 7) (2 5 8) (3 6 9)) | |
| (for [[x y z] (map vector '(1 2 3) '(4 5 6) '(7))] | |
| (list x y z)) | |
| => ((1 4 7)) | |
| (def zipwith (partial map (partial conj []))) | |
| (zipwith [1 2 3] [4 5 6] [7 8 9]) | |
| => ([1 4 7] [2 5 8] [3 6 9]) | |
| https://www.recurse.com/blog/13-list-comprehensions-in-eight-lines-of-clojure | |
| https://groups.google.com/forum/#!topic/comp.lang.lisp/DGkZ0Cia9Hg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment