Next: srfi strings spec pred, Up: srfi strings spec [Index]
In the procedure specifications of this SRFI the following conventions for arguments requirement are used:
The argument is a string.
The argument is a character.
Half–open string indices specifying a substring within a string
argumen; when optional, they default to 0
and the length of the
string, respectively. When specified, it must be the case that:
0 <= start <= end <= (string-length str)
for the corresponding parameter str. They typically restrict a procedure’s action to the indicated substring.
A unary character predicate procedure, returning a true/false value when applied to a character.
A value used to select/search for a character in a string:
The argument is an exact non–negative integer specifying an index into a string.
Exact non–negative integers specifying a length of a string or some number of characters.
The argument may be any value at all.
Passing values to procedures with these parameters that do not satisfy these types is an error.
An argument followed by ...
means zero–or–more elements; so the
procedure with the signature:
sum-squares x ...
takes zero or more arguments (x ...), while the procedure with signature:
spell-check doc dict1 dict2 ...
takes two required parameters (doc and dict1) and zero or more optional parameters (dict2 ...).
If a procedure is said to return “unspecified”, this means that nothing at all is said about what the procedure returns. Such a procedure is not even required to be consistent from call to call. It is simply required to return a value (or values) that may be passed to a command continuation, e.g. as the value of an expression appearing as a non–terminal subform of a begin expression. Note that in R5RS, this restricts such a procedure to returning a single value; non–R5RS systems may not even provide this restriction.
Unless explicitly stated, for all the functions: case–insensitive comparison is done by case–folding characters with the operation
(char-downcase (char-upcase c))
where the two case–mapping operations are assumed to be one–to–one, locale–insensitive and context–insensitive, and compatible with the one–to–one case mappings specified by Unicode’s UnicodeData.txt table:
Comparison is simply done on individual code–points of the string.
Next: srfi strings spec pred, Up: srfi strings spec [Index]