Next: , Previous: SRFI-14 Iterating Over Character Sets, Up: SRFI-14


39.12.5 Creating Character Sets

New character sets are produced with these procedures.

— Scheme Procedure: char-set-copy cs

Return a newly allocated character set containing all characters in cs.

— Scheme Procedure: char-set [rest ...]

Return a character set containing all given characters.

— Scheme Procedure: list->char-set list [base_cs]

Convert the character list list to a character set. If the character set base_cs is given, the character in this set are also included in the result.

— Scheme Procedure: list->char-set! list base_cs

Convert the character list list to a character set. The characters are added to base_cs and base_cs is returned.

— Scheme Procedure: string->char-set str [base_cs]

Convert the string str to a character set. If the character set base_cs is given, the characters in this set are also included in the result.

— Scheme Procedure: string->char-set! str base_cs

Convert the string str to a character set. The characters from the string are added to base_cs, and base_cs is returned.

— Scheme Procedure: char-set-filter pred cs [base_cs]

Return a character set containing every character from cs so that it satisfies pred. If provided, the characters from base_cs are added to the result.

— Scheme Procedure: char-set-filter! pred cs base_cs

Return a character set containing every character from cs so that it satisfies pred. The characters are added to base_cs and base_cs is returned.

— Scheme Procedure: ucs-range->char-set lower upper [error [base_cs]]

Return a character set containing all characters whose character codes lie in the half-open range [lower,upper).

If error is a true value, an error is signalled if the specified range contains characters which are not contained in the implemented character range. If error is #f, these characters are silently left out of the resultung character set.

The characters in base_cs are added to the result, if given.

— Scheme Procedure: ucs-range->char-set! lower upper error base_cs

Return a character set containing all characters whose character codes lie in the half-open range [lower,upper).

If error is a true value, an error is signalled if the specified range contains characters which are not contained in the implemented character range. If error is #f, these characters are silently left out of the resultung character set.

The characters are added to base_cs and base_cs is returned.

— Scheme Procedure: ->char-set x

Coerce x into a character set. x may be a string, a character or a character set.