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


2.9.3.4 Creating character sets

Function: char-set-copy cs

Return a copy of the character set cs; “copy” means that if either the input argument or the result value of this procedure is passed to one of the linear–update procedures described below, the other character set is guaranteed not to be altered.

Function: char-set char ...

Return a character set containing the given characters.

Function: list->char-set char-list
Function: list->char-set char-list base-cs
Function: list->char-set! char-list base-cs

Return a character set containing the characters in the list of characters char-list.

If the character set base-cs is provided, the characters from char-list are added to it. list->char-set! is allowed, but not required, to side–effect and reuse the storage in base-cs; list->char-set produces a fresh character set.

Function: string->char-set s
Function: string->char-set s base-cs
Function: string->char-set! s base-cs

Return a character set containing the characters in the string s.

If the character set base-cs is provided, the characters from s are added to it. string->char-set! is allowed, but not required, to side–effect and reuse the storage in base-cs; string->char-set produces a fresh character set.

Function: char-set-filter pred cs
Function: char-set-filter pred cs base-cs
Function: char-set-filter! pred cs base-cs

Return a character set containing every character c in cs such that (pred c) returns true.

If the character set base-cs is provided: the characters specified by pred are added to it. char-set-filter! is allowed, but not required, to side–effect and reuse the storage in base-cs; char-set-filter produces a fresh character set.

An implementation may not save away a reference to pred and invoke it after char-set-filter or char-set-filter! returns; that is, “lazy,” on–demand implementations are not allowed, as pred may have external dependencies on mutable data or have other side–effects.

Function: ucs-range->char-set lower upper
Function: ucs-range->char-set lower upper error?
Function: ucs-range->char-set lower upper error? base-cs
Function: ucs-range->char-set! lower upper error? base-cs

The arguments lower and upper are exact non–negative integers such that lower <= upper.

Return a character set containing every character whose ISO/IEC 10646 UCS-4 code lies in the half-open range [lower, upper).

If the requested range includes unassigned UCS values, these are silently ignored (the current UCS specification has “holes” in the space of assigned codes).

If the requested range includes “private” or “user space” codes, these are handled in an implementation–specific manner; however, a UCS- or Unicode-based Scheme implementation should pass them through transparently.

If any code from the requested range specifies a valid, assigned UCS character that has no corresponding representative in the implementation’s character type, then (1) an error is raised if error? is true, and (2) the code is ignored if error? is false (the default).

If character set base-cs is provided, the characters specified by the range are added to it. ucs-range->char-set! is allowed, but not required, to side–effect and reuse the storage in base-cs; ucs-range->char-set produces a fresh character set.

Function: ->char-set x

Coerces x into a char-set. x may be a string, character or char-set. A string is converted to the set of its constituent characters; a character is converted to a singleton set; a char-set is returned as–is. This procedure is intended for use by other procedures that want to provide user–friendly, wide–spectrum interfaces to their clients.


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