The vector-search module provides basic search and replace
capabilities upon restricted subsets of
<sequence>
-- primarily
<vector>
. Exploiting the known
properties of these types yields substantially better
performance than can be achieved for sequences in general.
find-first-key | [Method] |
Find the index of first element of a <vector>
Synopsis
find-first-key (seq, pred?, #key start, end, failure) => ()
Parameters
seq An instance of <vector>
.pred? An instance of <object>
. A<function>
that returns#t
for a matching condition.start:
An instance of <object>
. From which element to start the search Defaults to0
.end:
An instance of <object>
. Where to end the searchfailure:
An instance of <object>
. Returned if no match found
Return Values
None.
Description
Find the index of first element (after
start
but beforeend
) of a vector which satisfies the given predicate. If no matching element is found, returnfailure
. The defaults forstart
,end
andfailure
are, respectively, 0, size(vector), and#f
. This function is likefind-key
, but acceptsstart:
andend:
rather thanskip:
.
find-last-key | [Method] |
This is like find-first-key, but goes backward from end.
Synopsis
find-last-key (seq, pred?, #key start, end, failure) => ()
Parameters
seq An instance of <vector>
.pred? An instance of <object>
. A <function> that returns true for a matching conditionstart:
An instance of <object>
. From which element to start the search Defaults to0
.end:
An instance of <object>
. Where to end the searchfailure:
An instance of <object>
. Returned if no match found
Return Values
None.
Description
See the description for
find-first-key
.