find-index ( ... seq quot: ( ... elt i -- ... ? ) -- ... i elt )


Vocabulary
sequences

Inputs
seqa sequence
quota quotation with stack effect ( ... elt i -- ... ? )


Outputs
ithe index of the first match or f
eltthe first matching element or f


Word description
A variant of find where the quotation takes both an element and its index.

Definition


: find-index
( ... seq quot: ( ... elt i -- ... ? ) -- ... i elt )
[ 0 ] 2dip find-index-from ; inline