Function: map-every-p

map-every-p is a byte-compiled function defined in map.el.gz.

Signature

(map-every-p PRED MAP)

Documentation

Return non-nil if calling PRED on all elements of MAP returns non-nil.

PRED is called with two arguments: the key of an element and its value. The default implementation delegates to map-do.

Other relevant functions are documented in the map group.

Shortdoc

;; map
(map-every-p (lambda (k _) (oddp k)) (list '(1 . 2) '(4 . 6)))
    => nil
  (map-every-p (lambda (k v) (evenp (+ k v))) (list '(1 . 3) '(4 . 6)))
    => t

Implementations

(map-every-p PRED MAP) in `map.el'.

Undocumented

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/map.el.gz
(cl-defgeneric map-every-p (pred map)
  "Return non-nil if calling PRED on all elements of MAP returns non-nil.
PRED is called with two arguments: the key of an element and its value.
The default implementation delegates to `map-do'."
  ;; FIXME: Not sure if there's much benefit to defining it as defgeneric,
  ;; since as defined, I can't think of a map-type where we could provide an
  ;; algorithmically more efficient algorithm than the default.
  (catch 'map--break
    (map-do (lambda (key value)
              (or (funcall pred key value)
                  (throw 'map--break nil)))
            map)
    t))