Next: , Previous: , Up: char-sets   [Index]


26.4 Inspection

Function: char-set-size cs

Return an exact integer representing the number of characters in cs.

Function: char-set-count pred cs

Return the number of characters in cs for which the predicate function pred returns non–false.

Function: char-set-write cs
Function: char-set-write cs port

Write to port a chunk of Scheme code that, when evaluated, generates cs. When not given, port defaults to (current-output-port).

Function: char-set-hash cs
Function: char-set-hash cs bound

Compute a hash value for the character set cs. The optional argument bound is a non–negative exact integer specifying the range of the hash function; a positive value restricts the return value to the range [0, bound).

If bound is either zero or not given: the implementation may use an implementation–specific default value, chosen to be as large as is efficiently practical. For instance, the default range might be chosen for a given implementation to map all strings into the range of integers that can be represented with a single machine word.

Invariant:

(char-set=? cs1 cs2) ⇒ (= (char-set-hash cs1 b)
                           (char-set-hash cs2 b))