Movatterモバイル変換


[0]ホーム

URL:


[LISPWORKS][Common Lisp HyperSpec (TM)][Previous][Up][Next]


FunctionCOPY-LIST

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:

copy-alist,copy-seq,copy-tree

Notes:

The copy created isequal tolist, but noteq.


[Starting Points][Contents][Index][Symbols][Glossary][Issues]
Copyright 1996-2005, LispWorks Ltd. All rights reserved.


[8]ページ先頭

©2009-2025 Movatter.jp