Function: cl-position

cl-position is an autoloaded and byte-compiled function defined in cl-seq.el.gz.

Signature

(cl-position ITEM SEQ [KEYWORD VALUE]...)

Documentation

Find the first occurrence of ITEM in SEQ.

Return the index of the matching item, or nil if not found.

Keywords supported: :test :test-not :key :start :end :from-end

View in manual

Aliases

position (obsolete since 27.1)

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/cl-seq.el.gz
;;;###autoload
(defun cl-position (item seq &rest cl-keys)
  "Find the first occurrence of ITEM in SEQ.
Return the index of the matching item, or nil if not found.
\nKeywords supported:  :test :test-not :key :start :end :from-end
\n(fn ITEM SEQ [KEYWORD VALUE]...)"
  (declare (important-return-value t))
  (cl--parsing-keywords ( :test :test-not :key :if :if-not
                          (:start 0) :end :from-end) ()
    (cl--position item seq cl-start cl-end cl-from-end)))