emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lispref/lists.texi,v


From: Richard M. Stallman
Subject: [Emacs-diffs] Changes to emacs/lispref/lists.texi,v
Date: Sat, 14 Apr 2007 12:38:06 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Richard M. Stallman <rms>       07/04/14 12:38:06

Index: lists.texi
===================================================================
RCS file: /cvsroot/emacs/emacs/lispref/lists.texi,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -b -r1.69 -r1.70
--- lists.texi  7 Apr 2007 01:58:26 -0000       1.69
+++ lists.texi  14 Apr 2007 12:38:06 -0000      1.70
@@ -1366,6 +1366,9 @@
 (delq '(4) sample-list)
      @result{} (a c (4))
 @end group
+
+If you want to delete elements that are @code{equal} to a given value,
+use @code{delete} (see below).
 @end example
 
 @defun remq object list
@@ -1388,9 +1391,6 @@
      @result{} (a b c a b c)
 @end group
 @end example
address@hidden
-The function @code{delq} offers a way to perform this operation
-destructively.  See @ref{Sets And Lists}.
 @end defun
 
 @defun memql object list
@@ -1448,8 +1448,8 @@
 elements @code{equal} to @var{object} from @var{sequence}.  For lists,
 @code{delete} is to @code{delq} as @code{member} is to @code{memq}: it
 uses @code{equal} to compare elements with @var{object}, like
address@hidden; when it finds an element that matches, it removes the
-element just as @code{delq} would.
address@hidden; when it finds an element that matches, it cuts the
+element out just as @code{delq} would.
 
 If @code{sequence} is a vector or string, @code{delete} returns a copy
 of @code{sequence} with all elements @code{equal} to @code{object}
@@ -1459,8 +1459,22 @@
 
 @example
 @group
-(delete '(2) '((2) (1) (2)))
+(setq l '((2) (1) (2)))
+(delete '(2) l)
      @result{} ((1))
+l
+     @result{} ((2) (1))
+;; @r{If you want to change @code{l} reliably,}
+;; @r{write @code{(setq l (delete elt l))}.}
address@hidden group
address@hidden
+(setq l '((2) (1) (2)))
+(delete '(1) l)
+     @result{} ((2) (2))
+l
+     @result{} ((2) (2))
+;; @r{In this case, it makes no difference whether you set @code{l},}
+;; @r{but you should do so for the sake of the other case.}
 @end group
 @group
 (delete '(2) [(2) (1) (2)])
@@ -1470,7 +1484,7 @@
 @end defun
 
 @defun remove object sequence
-This function is the non-destructive counterpart of @code{delete}.  If
+This function is the non-destructive counterpart of @code{delete}.  It
 returns a copy of @code{sequence}, a list, vector, or string, with
 elements @code{equal} to @code{object} removed.  For example:
 
@@ -1509,7 +1523,8 @@
 @end defun
 
   See also the function @code{add-to-list}, in @ref{List Variables},
-for another way to add an element to a list stored in a variable.
+for a way to an element to a list stored in a variable and used as a
+set.
 
 @node Association Lists
 @section Association Lists




reply via email to

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