Skip to content

Instantly share code, notes, and snippets.

@LNA
Last active August 29, 2015 14:17
Show Gist options
  • Save LNA/19a8670fdfb5f2e1bbea to your computer and use it in GitHub Desktop.
Save LNA/19a8670fdfb5f2e1bbea to your computer and use it in GitHub Desktop.
Mapcat
(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