diff lisp/cl-extra.el @ 5312:f6471e4ae703

Avoid some dynamic scope stupidity in interpreted code, #'notany, #'notevery. 2010-12-29 Aidan Kehoe <kehoea@parhasard.net> * cl-extra.el (notany, notevery): Avoid some dynamic scope stupidity with local variable names in these functions, when they weren't prefixed with cl-; go into some more detail in the doc strings.
author Aidan Kehoe <kehoea@parhasard.net>
date Wed, 29 Dec 2010 23:38:38 +0000
parents 09fed7053634
children ba62563ec7c7 6506fcb40fcf
line wrap: on
line diff
--- a/lisp/cl-extra.el	Wed Dec 29 23:25:52 2010 +0000
+++ b/lisp/cl-extra.el	Wed Dec 29 23:38:38 2010 +0000
@@ -128,13 +128,23 @@
   `(lambda (&rest arguments) ,@(if documentation (list documentation))
      (not (apply ',function arguments))))
 
-(defun notany (cl-pred cl-seq &rest cl-rest)
-  "Return true if PREDICATE is false of every element of SEQ or SEQs."
-  (not (apply 'some cl-pred cl-seq cl-rest)))
+(defun notany (cl-predicate cl-seq &rest cl-rest)
+  "Return true if PREDICATE is false of every element of SEQUENCE.
+
+With optional SEQUENCES, call PREDICATE each time with as many arguments as
+there are SEQUENCES (plus one for the element from SEQUENCE).
+
+arguments: (PREDICATE SEQUENCES &rest SEQUENCES)"
+  (not (apply 'some cl-predicate cl-seq cl-rest)))
 
-(defun notevery (cl-pred cl-seq &rest cl-rest)
-  "Return true if PREDICATE is false of some element of SEQ or SEQs."
-  (not (apply 'every cl-pred cl-seq cl-rest)))
+(defun notevery (cl-predicate cl-seq &rest cl-rest)
+  "Return true if PREDICATE is false of some element of SEQUENCE.
+
+With optional SEQUENCES, call PREDICATE each time with as many arguments as
+there are SEQUENCES (plus one for the element from SEQUENCE).
+
+arguments: (PREDICATE SEQUENCES &rest SEQUENCES)"
+  (not (apply 'every cl-predicate cl-seq cl-rest)))
 
 ;;; Support for `loop'.
 (defalias 'cl-map-keymap 'map-keymap)