append - append an object to one or multiple lists
(import (rnrs)) ;R6RS
(import (rnrs base)) ;R6RS
(import (scheme r5rs)) ;R7RS
(import (scheme base)) ;R7RS
(append list ... obj)
Returns a possibly improper list consisting of the elements
of the first
followed by the elements of the other
as the cdr of the final pair.
An improper list
is not a list. Returns the empty list if called with no arguments.
The return value is made from new pairs for all arguments
but the last; the last is merely placed at the end of the new
Returns a single value. An improper list results if
is not a proper list.
(append '(x) '(y)) => (x y)
(append '(a) '(b c d)) => (a b c d)
(append '(a (b)) '((c))) => (a (b) (c))
(append '(a b) '(c . d)) => (a b c . d)
(append '() 'a) => a
(append) => ()
(append 'a) => a
Except for differences in error behavior, this procedure works the
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.
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.
procedure has existed in LISP since at least 1959.
The variants before R3RS only accepted proper lists.
Scheme before R2RS running on MacLISP accept any number of argments,
while in LISP 1.5 the procedure only accepted two arguments.
This page is part of the
It includes materials from the RnRS documents.
More information can be found at
Markup created by unroff 1.0sc, March 04, 2023.