Next: srfi char-sets spec std, Previous: srfi char-sets spec query, Up: srfi char-sets spec [Index]
Add/delete the char characters to/from character set cs.
Linear–update variants. These procedures are allowed, but not required, to side–effect their first parameter.
These procedures implement set complement, union, intersection, difference, and exclusive OR for character sets. The union, intersection and xor operations are n–ary. The difference function is also n–ary, associates to the left (that is, it computes the difference between its first argument and the union of all the other arguments), and requires at least one argument.
(char-set-difference (char-set #\a) (char-set #\b)) ⇒ (char-set #\a)
Boundary cases:
(char-set-union) ⇒ char-set:empty (char-set-intersection) ⇒ char-set:full (char-set-xor) ⇒ char-set:empty (char-set-difference cs) ⇒ cs
char-set-diff+intersection
returns two values: the difference and
the intersection of the arguments; it partitions its first argument. It
is almost equivalent to:
(values (char-set-difference cs1 cs2 ...) (char-set-intersection cs1 (char-set-union cs2 ...)))
but can be implemented more efficiently; when called with one argument: the first return value is a copy of the argument itself, the second return value is the empty set.
These are linear–update variants of the set–algebra functions. They are allowed, but not required, to side–effect their first (required) argument.
char-set-diff+intersection!
is allowed to side–effect both of
its two required arguments.
Next: srfi char-sets spec std, Previous: srfi char-sets spec query, Up: srfi char-sets spec [Index]