comparison lisp/cl-seq.el @ 5346:b4ef3128160c

Fix some testsuite failures, #'delete, #'delq, #'remove, #'remq. lisp/ChangeLog addition: 2011-01-23 Aidan Kehoe <kehoea@parhasard.net> * cl-macs.el (delete): * cl-macs.el (delq): * cl-macs.el (remove): * cl-macs.el (remq): Don't use the compiler macro if these functions were given the wrong number of arguments, as happens in lisp-tests.el. * cl-seq.el (remove, remq): Removed. I added these to subr.el, and forgot to remove them from here. tests/ChangeLog addition: 2011-01-23 Aidan Kehoe <kehoea@parhasard.net> * automated/lisp-tests.el (test-fun): #'delete* and friends can now throw a wrong-type-argument if handed a non-sequence; accept this too when checking for an error when passing a fixnum as the SEQUENCE argument. Check #'remove*, #'remove and #'remq too.
author Aidan Kehoe <kehoea@parhasard.net>
date Sun, 23 Jan 2011 13:13:54 +0000
parents d1b17a33450b
children 0af042a0c116
comparison
equal deleted inserted replaced
5345:db326b8fe982 5346:b4ef3128160c
54 ;; keyword-parsing code, which would avoid the necessity of the arguments: 54 ;; keyword-parsing code, which would avoid the necessity of the arguments:
55 ;; () lists in the docstrings, but that often breaks because of dynamic 55 ;; () lists in the docstrings, but that often breaks because of dynamic
56 ;; scope (e.g. a variable called start bound in this file and one in a 56 ;; scope (e.g. a variable called start bound in this file and one in a
57 ;; user-supplied test predicate may well interfere with each other). 57 ;; user-supplied test predicate may well interfere with each other).
58 58
59 ;; XEmacs change: these two are in subr.el in GNU Emacs.
60 (defun remove (cl-item cl-seq)
61 "Remove all occurrences of ITEM in SEQUENCE, testing with `equal'.
62
63 This is a non-destructive function; it makes a copy of SEQUENCE if necessary
64 to avoid corrupting the original SEQUENCE.
65 Also see: `remove*', `delete', `delete*'
66
67 arguments: (ITEM SEQUENCE)"
68 (remove* cl-item cl-seq :test #'equal))
69
70 (defun remq (cl-item cl-seq)
71 "Remove all occurrences of ITEM in SEQUENCE, comparing with `eq'.
72
73 This is a non-destructive function; it makes a copy of SEQUENCE to avoid
74 corrupting the original LIST. See also the more general `remove*'.
75
76 arguments: (ITEM SEQUENCE)"
77 (remove* cl-item cl-seq :test #'eq))
78
79 (defun remove-if (cl-predicate cl-seq &rest cl-keys) 59 (defun remove-if (cl-predicate cl-seq &rest cl-keys)
80 "Remove all items satisfying PREDICATE in SEQUENCE. 60 "Remove all items satisfying PREDICATE in SEQUENCE.
81 61
82 This is a non-destructive function; it makes a copy of SEQUENCE if necessary 62 This is a non-destructive function; it makes a copy of SEQUENCE if necessary
83 to avoid corrupting the original SEQUENCE. If SEQUENCE is a list, the copy 63 to avoid corrupting the original SEQUENCE. If SEQUENCE is a list, the copy