find-first-key

Find the index of first element of a <vector> that satisfies a predicate.

This function finds the index of first element (after start but before end) of a vector which satisfies the given predicate.  If no matching element is found, return failure.  The defaults for start, end and failure are, respectively, 0, size(vector), and #f.  This function is like find-key, but accepts start: and end: rather than skip:.

Exported from

Modifiers

sealed

Arguments

seqAn instance of <vector>.
pred?An instance of <function> that returns #t for a matching condition.
start:An instance of <integer> from which element to start the search.  Defaults to 0.
end:An instance of <integer> at which to end the search.  Defaults to the size of seq.
failure:An instance of <object>.  Returned if no match found.  Defaults to #f.

Values

key-or-failureAn instance of <integer> or the failure value.
The class of arrays of rank one (i.e., exactly one dimension).
Returns the key in a collection such that the corresponding collection element satisfies a predicate.
The vector-search module provides basic search and replace capabilities upon restricted subsets of <sequence> — primarily <vector>.
The class of objects that can be applied to arguments.
The class of integers.
The class of all Dylan objects.