GNU bug report logs - #12314
24.2.50; `add-to-history': use `setq' with `delete'

Previous Next

Package: emacs;

Reported by: "Drew Adams" <drew.adams <at> oracle.com>

Date: Thu, 30 Aug 2012 23:10:01 UTC

Severity: normal

Found in version 24.2.50

Done: Chong Yidong <cyd <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #49 received at 12314 <at> debbugs.gnu.org (full text, mbox):

From: "Drew Adams" <drew.adams <at> oracle.com>
To: "'Eli Zaretskii'" <eliz <at> gnu.org>,
	"'Andreas Schwab'" <schwab <at> linux-m68k.org>
Cc: 12314 <at> debbugs.gnu.org, cyd <at> gnu.org
Subject: RE: bug#12314: 24.2.50; `add-to-history': use `setq' with `delete'
Date: Sat, 8 Sep 2012 09:54:27 -0700
> > Even if the element is not the first one, you always have 
> > to think about other references that may exist to the
> > cons that is removed.
> 
> Sorry, I'm not sure how this is related.  Please elaborate.

(Think pointers.)  A variable stays pointed to the same cons cell - these
operations do not change that.  But they can change the relations among cons
cells: which of them point to which others.

(setq a  '(1 2 3 4))
(setq b  (cddr a))

a => (1 2 3 4)
b => (3 4)

(delq 4 b)

a => (1 2 3)
b => (3)

The value of variable `a' was changed by changing the value of `b', because `b'
points to a cons cell that is used in the list structure pointed to by `a'.





This bug report was last modified 12 years and 251 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.