Last active
August 29, 2015 14:17
-
-
Save LNA/19a8670fdfb5f2e1bbea to your computer and use it in GitHub Desktop.
Mapcat
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
(mapcat [1 2 3] [4 5 6]) | |
=> Gives an error. Mapcat wants a function and a coll, not two colls. | |
(maptcat str [4 5 6]) | |
=> Gives (\4 \5 \6). It applies the function its given to the coll its given. Then it concats the result. | |
(concat [4 5 6]) gives [4 5 6]. So really, mapcat is a great shortcut for accomplishing two things at once. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment