Everything Is a Sequence
Every aggregate data structure in Clojure can be viewed as a sequence. A sequence has three core capabilities:
You can get the first item in a sequence:
first returns nil if its argument is empty or nil.
You can get everything after the first item—the rest of a sequence:
rest returns an empty seq (not nil) if there are no more items.
You can construct a new sequence by adding an item to the front of an existing sequence. This is called consing:
(cons elem aseq)
Under the hood, these three capabilities are declared in the Java interface clojure.lang.ISeq. (Keep this in mind when reading about Clojure, because the name ISeq is often used interchangeably with seq.)
The seq function ...