May 2018
Beginner to intermediate
290 pages
6h 43m
English
If all we were talking about was first and rest, this whole sequence kerfuffle wouldn’t amount to much. The real power of sequences lies in the mountain of useful library functions that—like our my-count function—take any kind of collection, convert it to a sequence, and then do something interesting with the sequence. For example, if you have a seqable collection but it’s in the wrong order, you can sort it with sort:
| | (def titles ["Jaws" "Emma" "2001" "Dracula"]) |
| | |
| | (sort titles) ; Sequence: ("2001" "Dracula" "Emma" "Jaws") |
Like count, sort converts the collection you pass in into a sequence, sorts it, and returns the resulting sequence.
Seqa What? | |
|---|---|
|
Yes, seqable is a word, at least if you are a Clojurist. A seqable ... | |
Read now
Unlock full access