map-find-last ( ... seq quot: ( ... elt -- ... result/f ) -- ... result elt )
Factor handbook » The language » Collections » Sequence operations » Searching sequences

Prev:map-find ( ... seq quot: ( ... elt -- ... result/f ) -- ... result elt )


Vocabulary
sequences

Inputs
seqa sequence
quota quotation with stack effect ( ... elt -- ... result/f )


Outputs
resultthe last non-false result of the quotation
eltthe last matching element or f


Word description
Applies the quotation to each element of the sequence from the tail, until the quotation outputs a true value. If the quotation ever yields a result which is not f, then the value is output, along with the element of the sequence which yielded this.

See also
map-find

Definition


: map-find-last
( ... seq quot: ( ... elt -- ... result/f ) -- ... result elt )
[ find-last ] (map-find) ; inline