Function: cl-some

cl-some is an autoloaded and byte-compiled function defined in cl-extra.el.gz.

Signature

(cl-some PREDICATE SEQ...)

Documentation

Say whether PREDICATE is true for any element in the SEQ sequences.

More specifically, the return value of this function will be the same as the first return value of PREDICATE where PREDICATE has a non-nil value.

Aliases

org-some (obsolete since 9.0) some (obsolete since 27.1) filesets-some (obsolete since 28.1)

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/cl-extra.el.gz
;;;###autoload
(defun cl-some (cl-pred cl-seq &rest cl-rest)
  "Say whether PREDICATE is true for any element in the SEQ sequences.
More specifically, the return value of this function will be the
same as the first return value of PREDICATE where PREDICATE has a
non-nil value.

\n(fn PREDICATE SEQ...)"
  (if (or cl-rest (nlistp cl-seq))
      (catch 'cl-some
        (apply #'cl-map nil
               (lambda (&rest cl-x)
                 (let ((cl-res (apply cl-pred cl-x)))
                   (if cl-res (throw 'cl-some cl-res))))
	       cl-seq cl-rest) nil)
    (let ((cl-x nil))
      (while (and cl-seq (not (setq cl-x (funcall cl-pred (pop cl-seq))))))
      cl-x)))