Created
November 20, 2016 01:11
-
-
Save practicalli-johnny/72a00ca49d60b16bbde263b0e76d33fc to your computer and use it in GitHub Desktop.
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
(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