From: Nils Goesche
Subject: nconc question
Date: 
Message-ID: <874rzkf5u3.fsf@darkstar.cartan>
Hi!

In the Common Lisp HyperSpec (CLHS) is an example for the usage
of the `nconc' function:

(setq x '(a b c)) =>  (A B C)
(setq y '(d e f)) =>  (D E F)
(nconc x y) =>  (A B C D E F)
x =>  (A B C D E F)

At another place, I read that you are not allowed to modify a
list literal like '(a b c).  So, isn't this example illegal?

Regards,
-- 
Nils Goesche
Ask not for whom the <CONTROL-G> tolls.
From: SRS
Subject: Re: nconc question
Date: 
Message-ID: <92sdge$le1$1@nnrp1.deja.com>
In article <··············@darkstar.cartan>,
  Nils Goesche <······@t-online.de> wrote:
> In the Common Lisp HyperSpec (CLHS) is an example for the usage
> of the `nconc' function:
>
> (setq x '(a b c)) =>  (A B C)
> (setq y '(d e f)) =>  (D E F)
> (nconc x y) =>  (A B C D E F)
> x =>  (A B C D E F)
>
> At another place, I read that you are not allowed to modify a
> list literal like '(a b c).  So, isn't this example illegal?

You are right, it was decided in the X3j13 vote CONSTANT-
MODIFICATION:DISALLOW that constants (literal, quoted, symbolic) may
not be modified. In the above case, you would need to do (setf x
(list 'a 'b 'c)) for example. So this indeed seems like a mistake in
the HyperSpec.

-- SRS


Sent via Deja.com
http://www.deja.com/