Next: , Previous: , Up: vectors   [Index]


24.10 Prefixes and suffixes

Function: %vector-prefix-length vec1 start1 past1 vec2 start2 past2
Macro: vector-prefix-length V1 V2

Return the length of the longest common prefix of the two subvectors. This is equivalent to the mismatch index for the vectors (modulo the start index offsets).

Function: %vector-suffix-length vec1 start1 past1 vec2 start2 past2
Macro: vector-suffix-length V1 V2

Return the length of the longest common suffix of the two subvectors.

Function: %vector-prefix? vec1 start1 past1 vec2 start2 past2
Macro: vector-prefix? V1 V2

Return #t if the selected subvector of vec1 is a prefix of the selected subvector of vec2, otherwise return #f. Notice that the empty vector is a prefix of every vector.

Function: %vector-suffix? vec1 start1 past1 vec2 start2 past2
Macro: vector-suffix? V1 V2

Return #t if the selected subvector of vec1 is a suffix of the selected subvector of vec2, otherwise return #f. Notice that the empty vector is not a suffix of every vector.