bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Drew Adams
Subject: bug#12314: 24.2.50; `add-to-history': use `setq' with `delete'
Date: Sat, 8 Sep 2012 09:42:59 -0700

> Why is it even necessary to talk about destructive modifications, if
> we are to advise to assign the result anyway?

Not sure I understand the question.  It is because these operations can be
destructive of list structure that we advise that.

These operations are not concerned with any variables, period - they act only on
list structure.

If you have variables that point to some list structure that you modify somehow,
then it is up to you to ensure that the variables point to what you want them to
point to after such modification.

It all depends on what you want/need.

(This is a bit like using pointers.  A variable points to a particular cons
cell.  Modifying one or more cons cells in a chain might or might not change
that particular cons cell or cells that its cdr points to.  The variable
continues to point to the same cons cell, but that cell might not still reflect
the "list" that you expect it to reflect.)






reply via email to

[Prev in Thread] Current Thread [Next in Thread]