| list-tail(3scm) | Scheme Programmer's Manual | list-tail(3scm) |
NAME
list-tail - skip elements of a list
LIBRARY
(import (rnrs)) ;R6RS (import (rnrs base)) ;R6RS (import (scheme r5rs)) ;R7RS (import (scheme base)) ;R7RS
SYNOPSIS
(list-tail list k)
DESCRIPTION
Returns the subchain of pairs of list obtained by omitting the first k elements.
IMPLEMENTATION NOTES
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.
RETURN VALUES
Returns a single value; a subchain of pairs from list.
EXAMPLES
(list-tail '(a b c d) 2) => (c d)
COMPATIBILITY
Apart from error conditions, this procedure works the same everywhere.
ERRORS
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.
SEE ALSO
STANDARDS
R4RS, IEEE Scheme, R5RS, R6RS, R7RS
HISTORY
This procedure first appeared in R2RS.
AUTHORS
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 |