Skip to content

Selectors

Scheme Procedure: first pair

Scheme Procedure: second pair

Scheme Procedure: third pair

Scheme Procedure: fourth pair

Scheme Procedure: fifth pair

Scheme Procedure: sixth pair

Scheme Procedure: seventh pair

Scheme Procedure: eighth pair

Scheme Procedure: ninth pair

Scheme Procedure: tenth pair

These are synonyms for car, cadr, caddr, ….

Scheme Procedure: car+cdr pair

Return two values, the CAR and the CDR of pair.

emacs-lisp
(car+cdr '(0 1 2 3))

0
(1 2 3)

Scheme Procedure: take lst i

Scheme Procedure: take! lst i

Return a list containing the first i elements of lst.

take! may modify the structure of the argument list lst in order to produce the result.

Scheme Procedure: drop lst i

Return a list containing all but the first i elements of lst.

Scheme Procedure: take-right lst i

Return a list containing the i last elements of lst. The return shares a common tail with lst.

Scheme Procedure: drop-right lst i

Scheme Procedure: drop-right! lst i

Return a list containing all but the i last elements of lst.

drop-right always returns a new list, even when i is zero. drop-right! may modify the structure of the argument list lst in order to produce the result.

Scheme Procedure: split-at lst i

Scheme Procedure: split-at! lst i

Return two values, a list containing the first i elements of the list lst and a list containing the remaining elements.

split-at! may modify the structure of the argument list lst in order to produce the result.

Scheme Procedure: last lst

Return the last element of the non-empty, finite list lst.