![[LISPWORKS]](/image.pl?url=http%3a%2f%2fwww.lispworks.com%2fdocumentation%2fHyperSpec%2fBody%2f..%2fGraphics%2fLWSmall.gif&f=jpg&w=240)
![[Common Lisp HyperSpec (TM)]](/image.pl?url=http%3a%2f%2fwww.lispworks.com%2fdocumentation%2fHyperSpec%2fBody%2f..%2fGraphics%2fCLHS_Sm.gif&f=jpg&w=240)
Syntax:
copy-listlist =>copy
Arguments and Values:
list---aproper list or adotted list.
copy---alist.
Description:
Returns acopy oflist. Iflist is adotted list, the resultinglist will also be adotted list.
Only thelist structure oflist is copied; theelements of the resulting list are thesame as the correspondingelements of the givenlist.
Examples:
(setq lst (list 1 (list 2 3))) => (1 (2 3)) (setq slst lst) => (1 (2 3)) (setq clst (copy-list lst)) => (1 (2 3)) (eq slst lst) =>true (eq clst lst) =>false (equal clst lst) =>true (rplaca lst "one") => ("one" (2 3)) slst => ("one" (2 3)) clst => (1 (2 3)) (setf (caadr lst) "two") => "two" lst => ("one" ("two" 3)) slst => ("one" ("two" 3)) clst => (1 ("two" 3))Side Effects: None.
Affected By: None.
Exceptional Situations:
The consequences are undefined iflist is acircular list.
See Also:
Notes:
The copy created isequal tolist, but noteq.