common-lisp Types of Lists Plain Lists


Example

Plain lists are the simplest type of list in Common Lisp. They are an ordered sequence of elements. They support basic operations like getting the first element of a list and the rest of a list in constant time, support random access in linear time.

(list 1 2 3)
;=> (1 2 3)

(first (list 1 2 3))
;=> 1

(rest (list 1 2 3))
;=> (2 3)

There are many functions that operate on "plain" lists, insofar as they only care about the elements of the list. These include find, mapcar, and many others. (Many of those functions will also work on 17.1 Sequence Concepts for some of these functions.