Created
January 28, 2014 03:19
-
-
Save ionrock/8661766 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
craps.core=> (def my-list '(1 2 3 4)) | |
#'craps.core/my-list | |
craps.core=> (map println my-list) | |
(1 | |
2 | |
nil 3 | |
nil 4 | |
nil nil) | |
craps.core=> (map print my-list) | |
(12nil 3nil 4nil nil) | |
craps.core=> (def my-list [1 2 3 4]) | |
#'craps.core/my-list | |
craps.core=> (map print my-list) | |
(1234nil nil nil nil) | |
craps.core=> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
So, the nils show up b/c map is lazy. The output is being interspersed with the resulting sequence. Since println doesn't return anything, you get
'(nil nil nil nil)
.