Certain non-destructive lisp operators are allowed to return their
list arguments (or tails of them) without copying them. Is this true
of reverse? For example, could a correct implementation return t for
the second of the following two expressions?
(setq a '(1))
(eq a (reverse a))
David
--
----------------------------------
David Kurlander Department of Computer Science
···@cs.columbia.edu Columbia University
In article <······················@cs.columbia.edu> ···@cs.columbia.edu (David Kurlander) writes:
>Certain non-destructive lisp operators are allowed to return their
>list arguments (or tails of them) without copying them. Is this true
>of reverse?
No. REVERSE is documented as returning a new sequence containing the
elements of the argument sequence in reverse order. Thus, (reverse seq) is
equivalent to (nreverse (copy-seq seq)).
--
Barry Margolin, Thinking Machines Corp.
······@think.com
{uunet,harvard}!think!barmar