Previous: , Up: iklib vectors   [Index]


6.28.6 Miscellaneous vector operations

Function: vector-reset! vec
Function: vector-reset! vec start end

vec must be a vector, and start and end must be exact integer objects satisfying:

0 <= start <= end < (vector-length vec)

Reset to void the selected range of slots beginning with index start (inclusive) and ending with index end (exclusive). Return unspecified values.

Function: sorted-vector-binary-search item< vec sought

Return #f or a non–negative fixnum representing the index at which sought is present in the sorted vector vec. The procedure item< is used to compare the items from vec and the object sought.

(sorted-vector-binary-search < '#(0 1 2 3 4 5 6 7 8 9) 3)
⇒ 3

(sorted-vector-binary-search < '#(0 1 2 3 4 5 6 7 8 9) 999)
⇒ #f

(sorted-vector-binary-search symbol<?
   '#(a b c d e f g h i l m) 'd)
⇒ 3