comparison lisp/cl-extra.el @ 5445:6506fcb40fcf

Merged with trunk.
author Mats Lidell <matsl@xemacs.org>
date Fri, 31 Dec 2010 00:27:29 +0100
parents 8d29f1c4bb98 f6471e4ae703
children a9094f28f9a9
comparison
equal deleted inserted replaced
5444:388762703a21 5445:6506fcb40fcf
124 (defun complement (function &optional documentation) 124 (defun complement (function &optional documentation)
125 "Return a function which gives the logical inverse of what FUNCTION would." 125 "Return a function which gives the logical inverse of what FUNCTION would."
126 `(lambda (&rest arguments) ,@(if documentation (list documentation)) 126 `(lambda (&rest arguments) ,@(if documentation (list documentation))
127 (not (apply ',function arguments)))) 127 (not (apply ',function arguments))))
128 128
129 (defun notany (cl-pred cl-seq &rest cl-rest) 129 (defun notany (cl-predicate cl-seq &rest cl-rest)
130 "Return true if PREDICATE is false of every element of SEQ or SEQs." 130 "Return true if PREDICATE is false of every element of SEQUENCE.
131 (not (apply 'some cl-pred cl-seq cl-rest))) 131
132 132 With optional SEQUENCES, call PREDICATE each time with as many arguments as
133 (defun notevery (cl-pred cl-seq &rest cl-rest) 133 there are SEQUENCES (plus one for the element from SEQUENCE).
134 "Return true if PREDICATE is false of some element of SEQ or SEQs." 134
135 (not (apply 'every cl-pred cl-seq cl-rest))) 135 arguments: (PREDICATE SEQUENCES &rest SEQUENCES)"
136 (not (apply 'some cl-predicate cl-seq cl-rest)))
137
138 (defun notevery (cl-predicate cl-seq &rest cl-rest)
139 "Return true if PREDICATE is false of some element of SEQUENCE.
140
141 With optional SEQUENCES, call PREDICATE each time with as many arguments as
142 there are SEQUENCES (plus one for the element from SEQUENCE).
143
144 arguments: (PREDICATE SEQUENCES &rest SEQUENCES)"
145 (not (apply 'every cl-predicate cl-seq cl-rest)))
136 146
137 ;;; Support for `loop'. 147 ;;; Support for `loop'.
138 (defalias 'cl-map-keymap 'map-keymap) 148 (defalias 'cl-map-keymap 'map-keymap)
139 149
140 (defun cl-map-keymap-recursively (cl-func-rec cl-map &optional cl-base) 150 (defun cl-map-keymap-recursively (cl-func-rec cl-map &optional cl-base)