《通链参考手册》


Function COPY-LIST

●语法设定:

copy-list list => copy

●参数和值:

list---a proper list or a dotted list.

copy---a list.

●详情:

Returns a copy of list. If list is a dotted list, the resulting list will also be a dotted list.

Only the list structure of list is copied; the elements of the resulting list are the same as the corresponding elements of the given list.

●例子:

 (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))

●副作用: None.

●受制于: 无。

●例外情况:

The consequences are undefined if list is a circular list.

●更多信息:

copy-alist, copy-seq, copy-tree

●说明:

The copy created is equal to list, but not eq.


◇首页 § ◎章节目录 § □内容索引 § ○符号索引 § △术语表 § ※设计草案