Skip to content

Instantly share code, notes, and snippets.

@sudowork
Created April 1, 2013 10:38
Show Gist options
  • Save sudowork/5284224 to your computer and use it in GitHub Desktop.
Save sudowork/5284224 to your computer and use it in GitHub Desktop.
; Creating vectors
user=> [:a :b :c]
[:a :b :c]
; Operating on vectors
user=> (first [:a :b :c])
:a
user=> (nth [:a :b :c] 2) ; NOTE: 0-based index
:c
user=> ([:a :b :c] 2)
:c
user=> (last [:a :b :c])
:c
; Concatenating two vectors results in a Sequence
user=> (concat [:a] [:b :c])
(:a :b :c) ; notice this is not a vector anymore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment