Scheme Programmer's Manual

NAME

char-general-category - Unicode character category

LIBRARY

(import (rnrs))                     ;R6RS
(import (rnrs unicode))             ;R6RS

SYNOPSIS

(char-general-category char)

DESCRIPTION

Returns a symbol representing the Unicode general category of char.

The category is one of the following symbols.

SymbolDescription
LuLetter, uppercase
LlLetter, lowercase
LtLetter, titlecase
LmLetter, modifier
LoLetter, other
MnMark, nonspacing
McMark, spacing combining
MeMark, enclosing
NdNumber, decimal digit
NlNumber, letter
NoNumber, other
PcPunctuation, connector
PdPunctuation, dash
PsPunctuation, open
PePunctuation, close
PiPunctuation, initial quote
PfPunctuation, final
PoPunctuation, other
SmSymbol, math
ScSymbol, currency
SkSymbol, modifier
SoSymbol, other
ZsSeparator, space
ZlSeparator, line
ZpSeparator, paragraph
CcOther, control
CfOther, format
CsOther, surrogate
CoOther, private use
CnOther, not assigned

RETURN VALUES

Returns a single symbol.

EXAMPLES

(char-general-category #\a)
   => Ll (char-general-category #\space)
   => Zs (char-general-category #\x10FFFF)
   => Cn

APPLICATION USAGE

This procedure commonly appears in Scheme readers. Both R6RS and R7RS define the lexical syntax in terms of Unicode general categories. Another use is in algorithms for rendering text.

COMPATIBILITY

This procedure is only present in R6RS (but any implementation that supports Unicode will necessarily have access to the data). The exact values returned will depend on which version of the Unicode database was used to generate the lookup tables.

ERRORS

This procedure can raise exceptions with the following condition types:
&assertion (R6RS)
The wrong number of arguments was passed or an argument was outside its domain.

SEE ALSO

char-alphabetic?(3)

STANDARDS

R6RS

AUTHORS

This page is part of the scheme-manpages project. It includes materials from the RnRS documents. More information can be found at

Index

NAME
LIBRARY
SYNOPSIS
DESCRIPTION
RETURN VALUES
EXAMPLES
APPLICATION USAGE
COMPATIBILITY
ERRORS
SEE ALSO
STANDARDS
AUTHORS
Return to Main Contents