(guile.info.gz) SRFI-13 Comparison
Info Catalog
(guile.info.gz) SRFI-13 Modification
(guile.info.gz) SRFI-13
(guile.info.gz) SRFI-13 Prefixes/Suffixes
39.11.7 Comparison
------------------
The procedures in this section are used for comparing strings in
different ways. The comparison predicates differ from those in R5RS in
that they do not only return `#t' or `#f', but the mismatch index in
the case of a true return value.
`string-hash' and `string-hash-ci' are for calculating hash values
for strings, useful for implementing fast lookup mechanisms.
-- Scheme Procedure: string-compare s1 s2 proc_lt proc_eq proc_gt
[start1 end1 start2 end2]
-- Scheme Procedure: string-compare-ci s1 s2 proc_lt proc_eq proc_gt
[start1 end1 start2 end2]
Apply PROC_LT, PROC_EQ, PROC_GT to the mismatch index, depending
upon whether S1 is less than, equal to, or greater than S2. The
mismatch index is the largest index I such that for every 0 <= J <
I, S1[J] = S2[J] - that is, I is the first position that does not
match. The character comparison is done case-insensitively.
-- Scheme Procedure: string= s1 s2 [start1 end1 start2 end2]
-- Scheme Procedure: string<> s1 s2 [start1 end1 start2 end2]
-- Scheme Procedure: string< s1 s2 [start1 end1 start2 end2]
-- Scheme Procedure: string> s1 s2 [start1 end1 start2 end2]
-- Scheme Procedure: string<= s1 s2 [start1 end1 start2 end2]
-- Scheme Procedure: string>= s1 s2 [start1 end1 start2 end2]
Compare S1 and S2 and return `#f' if the predicate fails.
Otherwise, the mismatch index is returned (or END1 in the case of
`string='.
-- Scheme Procedure: string-ci= s1 s2 [start1 end1 start2 end2]
-- Scheme Procedure: string-ci<> s1 s2 [start1 end1 start2 end2]
-- Scheme Procedure: string-ci< s1 s2 [start1 end1 start2 end2]
-- Scheme Procedure: string-ci> s1 s2 [start1 end1 start2 end2]
-- Scheme Procedure: string-ci<= s1 s2 [start1 end1 start2 end2]
-- Scheme Procedure: string-ci>= s1 s2 [start1 end1 start2 end2]
Compare S1 and S2 and return `#f' if the predicate fails.
Otherwise, the mismatch index is returned (or END1 in the case of
`string='. These are the case-insensitive variants.
-- Scheme Procedure: string-hash s [bound start end]
-- Scheme Procedure: string-hash-ci s [bound start end]
Return a hash value of the string S in the range 0 ... BOUND - 1.
`string-hash-ci' is the case-insensitive variant.
Info Catalog
(guile.info.gz) SRFI-13 Modification
(guile.info.gz) SRFI-13
(guile.info.gz) SRFI-13 Prefixes/Suffixes
automatically generated byinfo2html