Fundamentals of CS I (CS151 2001S) : Reference

append: join lists

Parametersl1 .. ln, n lists.
PurposeBuilds a new list which consists of the elements of all the parameter lists joined together.
ProducesThe new list.
PreconditionsZero or more parameters.
Each parameter is a list (verified for all but last parameter).
PostconditionsDoes not affect any of the parameters.
> (append)
> (append (list 'a 'b 'c) (list 1 2))
(a b c 1 2)
> (append (list 'a 'b 'c) ())
(a b c)
> (append (list 'a) (list 1 2 3) lists)
(a 1 2 3 (a b c) (1) (4 2 1 0))
> (append lists lists)
((a b c) (1) (4 2 1 0) (a b c) (1) (4 2 1 0))

Disclaimer: I usually create these pages on the fly. This means that they are rarely proofread and may contain bad grammar and incorrect details. It also means that I may update them regularly (see the history for more details). Feel free to contact me with any suggestions for changes.

This page was generated by Siteweaver on Thu Feb 22 05:47:33 2001.
This page may be found at
You may validate this page's HTML.
The source was last modified Sun Jan 28 12:29:42 2001.