Next: Creating Character Sets, Previous: Character Set Predicates/Comparison, Up: Character Sets
Character set cursors are a means for iterating over the members of a
character sets. After creating a character set cursor with
char-set-cursor
, a cursor can be dereferenced with
char-set-ref
, advanced to the next member with
char-set-cursor-next
. Whether a cursor has passed past the last
element of the set can be checked with end-of-char-set?
.
Additionally, mapping and (un-)folding procedures for character sets are provided.
Return a cursor into the character set cs.
Return the character at the current cursor position cursor in the character set cs. It is an error to pass a cursor for which
end-of-char-set?
returns true.
Advance the character set cursor cursor to the next character in the character set cs. It is an error if the cursor given satisfies
end-of-char-set?
.
Return
#t
if cursor has reached the end of a character set,#f
otherwise.
Fold the procedure kons over the character set cs, initializing it with knil.
This is a fundamental constructor for character sets.
- g is used to generate a series of “seed” values from the initial seed: seed, (g seed), (g^2 seed), (g^3 seed), ...
- p tells us when to stop – when it returns true when applied to one of the seed values.
- f maps each seed value to a character. These characters are added to the base character set base_cs to form the result; base_cs defaults to the empty set.
This is a fundamental constructor for character sets.
- g is used to generate a series of “seed” values from the initial seed: seed, (g seed), (g^2 seed), (g^3 seed), ...
- p tells us when to stop – when it returns true when applied to one of the seed values.
- f maps each seed value to a character. These characters are added to the base character set base_cs to form the result; base_cs defaults to the empty set.