list-tail(3scm) Scheme Programmer's Manual list-tail(3scm)

list-tail - skip elements of a list

(import (rnrs))                     ;R6RS
(import (rnrs base))                ;R6RS
(import (scheme r5rs))              ;R7RS
(import (scheme base))              ;R7RS

(list-tail list k)

Returns the subchain of pairs of list obtained by omitting the first k elements.

Implementation responsibilities: The implementation must check that list is a chain of pairs whose length is at least k. It should not check that it is a chain of pairs beyond this length.

Returns a single value; a subchain of pairs from list.

(list-tail '(a b c d) 2)  =>  (c d)

Apart from error conditions, this procedure works the same everywhere.

This procedure can raise exceptions with the following condition types:
&assertion (R6RS)
The wrong number of arguments was passed or an argument was outside its domain. In particular, list should be a list of size at least k.
R7RS
The assertions described above are errors. Implementations may signal an error, extend the procedure's domain of definition to include such arguments, or fail catastrophically.

list-ref(3scm), cdr(3scm)

R4RS, IEEE Scheme, R5RS, R6RS, R7RS

This procedure first appeared in R2RS.

This page is part of the scheme-manpages project. It includes materials from the RnRS documents. More information can be found at https://weinholt.se/scheme/manpages/.

2023-08-13