Skip to content

Instantly share code, notes, and snippets.

@practicalli-johnny
Created November 20, 2016 01:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save practicalli-johnny/72a00ca49d60b16bbde263b0e76d33fc to your computer and use it in GitHub Desktop.
Save practicalli-johnny/72a00ca49d60b16bbde263b0e76d33fc to your computer and use it in GitHub Desktop.
(first [1 2 3])
;; In addition to first, you’ll often want to get the remaining elements in a collection. There are two ways to do this:
;; (rest [1 2 3])
;; (next [1 2 3])
;; rest and next both return “everything but the first element”. They differ only by what happens when there are no remaining elements:
;; (rest [1])
;; (next [1])
;; We can get the final element of any collection with last:
;; (last [1 2 3])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment