Function: seq-position
seq-position is an autoloaded and byte-compiled function defined in
seq-25.el.
Signature
(seq-position SEQUENCE ELT &optional TESTFN)
Documentation
Return the (zero-based) index of the first element in SEQUENCE "equal" to ELT.
"Equality" is defined by the function TESTFN, which defaults to equal.
Other relevant functions are documented in the sequence and string groups.
Shortdoc
;; string
(seq-position "foobarzot" ?z)
;; sequence
(seq-position '(a b c) 'c)
=> 2
Implementations
(sequence elt &optional testfn) in `seq-25.el'.
Undocumented
Source Code
;; Defined in ~/.emacs.d/elpa/seq-2.24/seq-25.el
;;;###autoload
(cl-defgeneric seq-position (sequence elt &optional testfn)
"Return the (zero-based) index of the first element in SEQUENCE \"equal\" to ELT.
\"Equality\" is defined by the function TESTFN, which defaults to `equal'."
(let ((index 0))
(catch 'seq--break
(seq-doseq (e sequence)
(when (funcall (or testfn #'equal) e elt)
(throw 'seq--break index))
(setq index (1+ index)))
nil)))