@c -*-texinfo-*-
@c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2001,
-@c 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+@c Copyright (C) 1990-1995, 1998-1999, 2001-2012 Free Software Foundation, Inc.
@c See the file elisp.texi for copying conditions.
@setfilename ../../info/lists
@node Lists, Sequences Arrays Vectors, Strings and Characters, Top
@result{} nil
@end group
@group
-(setq l (make-list 3 '(a b))
+(setq l (make-list 3 '(a b)))
@result{} ((a b) (a b) (a b))
(eq (car l) (cadr l))
@result{} t
@cindex CL note---lack @code{union}, @code{intersection}
@quotation
@b{Common Lisp note:} Common Lisp has functions @code{union} (which
-avoids duplicate elements) and @code{intersection} for set operations,
-but GNU Emacs Lisp does not have them. You can write them in Lisp if
-you wish.
+avoids duplicate elements) and @code{intersection} for set operations.
+Although standard GNU Emacs Lisp does not have them, the @file{cl}
+library provides versions. @inforef{Top, Overview, cl}.
@end quotation
@defun memq object list
(delq '(4) sample-list)
@result{} (a c (4))
@end group
+@end example
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
This function returns a copy of @var{list}, with all elements removed
l
@result{} ((2) (1))
;; @r{If you want to change @code{l} reliably,}
-;; @r{write @code{(setq l (delete elt l))}.}
+;; @r{write @code{(setq l (delete '(2) l))}.}
@end group
@group
(setq l '((2) (1) (2)))
(ring-remove fifo)))
@result{} (0 t one t "two")
@end lisp
-
-@ignore
- arch-tag: 31fb8a4e-4aa8-4a74-a206-aa00451394d4
-@end ignore