A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.lispworks.com/documentation/lw51/CLHS/Body/f_cp_lis.htm below:

CLHS: Function COPY-LIST

CLHS: Function COPY-LIST Function COPY-LIST

Syntax:

copy-list list => copy

Arguments and Values:

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

copy---a list.

Description:

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.

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 if list is a circular list.

See Also:

copy-alist, copy-seq, copy-tree

Notes:

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


Copyright 1996-2005, LispWorks Ltd. All rights reserved.

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4