Next: , Up: srfi strings spec   [Index]


2.8.3.1 Introduction

In the procedure specifications of this SRFI the following conventions for arguments requirement are used:

str

The argument is a string.

char

The argument is a character.

start
end

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.

pred

A unary character predicate procedure, returning a true/false value when applied to a character.

char/char-set/pred

A value used to select/search for a character in a string:

i

The argument is an exact non–negative integer specifying an index into a string.

len
nchars

Exact non–negative integers specifying a length of a string or some number of characters.

obj

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:

ftp://ftp.unicode.org/Public/UNIDATA/UnicodeData.txt

Comparison is simply done on individual code–points of the string.


Next: , Up: srfi strings spec   [Index]