Skip to content

Instantly share code, notes, and snippets.

@LNA
Last active August 29, 2015 14:17
Show Gist options
  • Save LNA/13178c620bde35721afb to your computer and use it in GitHub Desktop.
Save LNA/13178c620bde35721afb to your computer and use it in GitHub Desktop.
Concat & Conj
(concat [1 2 3] 4)
=> gives an error. Remember, concat wants to squish together 2 differnt collections of data.
(conj [1 2 3] 4)
=> gives [1 2 3 4]. Sucessfully adds an item to a collection. Added it to the end because the coll is a vector.
(concat [1 2 3] [4])
=> gives [1 2 3 4]. concat wants to squish togeter 2 different coll of data to form 1 coll of data.
(conj [1 2 3] [4])
=> gives [1 2 3 [4]]. conj wants to add an item to a coll. And the item you gave it was a vector.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment