Mercurial > hg > xemacs-beta
changeset 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 | 07d24b1f27a7 |
children | 5ed261fd2bd9 |
files | lisp/ChangeLog lisp/cl-extra.el |
diffstat | 2 files changed, 23 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/ChangeLog Wed Dec 29 23:25:52 2010 +0000 +++ b/lisp/ChangeLog Wed Dec 29 23:38:38 2010 +0000 @@ -1,3 +1,10 @@ +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. + 2010-12-29 Aidan Kehoe <kehoea@parhasard.net> * byte-optimize.el (side-effect-free-fns): #'remove, #'remq are
--- 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)