Module libc/ctype
libc/ctype
Stability: unstable — a raw C binding, not a Yo design. These take and return `int` because C's do (a negative value other than `EOF` is undefined behaviour), they classify one BYTE, and the answer depends on the process locale. Yo's own classification is on `rune` and is Unicode, not byte, wide: `std/string/rune.yo` (`is_digit`, `is_alphabetic`, …) is the supported surface, and nothing in the tree imports this module. It would only freeze if Yo decided to expose C locale behaviour deliberately, which it has not. — stable modules only change additively; this one may still change.
C11 <ctype.h> — character classification and conversion functions.
Stability
unstable — a raw C binding, not a Yo design. These take and return int
because C's do (a negative value other than EOF is undefined
behaviour), they classify one BYTE, and the answer depends on the
process locale. Yo's own classification is on rune and is Unicode, not
byte, wide: std/string/rune.yo (is_digit, is_alphabetic, …) is the
supported surface, and nothing in the tree imports this module. It would
only freeze if Yo decided to expose C locale behaviour deliberately,
which it has not.
Functions
isalnum
function
fn(c : int) -> int
Parameters
| Name | Type | Notes |
|---|---|---|
c | int |
Returns: int
isalpha
function
fn(c : int) -> int
Parameters
| Name | Type | Notes |
|---|---|---|
c | int |
Returns: int
isblank
function
fn(c : int) -> int
Parameters
| Name | Type | Notes |
|---|---|---|
c | int |
Returns: int
iscntrl
function
fn(c : int) -> int
Parameters
| Name | Type | Notes |
|---|---|---|
c | int |
Returns: int
isdigit
function
fn(c : int) -> int
Parameters
| Name | Type | Notes |
|---|---|---|
c | int |
Returns: int
isgraph
function
fn(c : int) -> int
Parameters
| Name | Type | Notes |
|---|---|---|
c | int |
Returns: int
islower
function
fn(c : int) -> int
Parameters
| Name | Type | Notes |
|---|---|---|
c | int |
Returns: int
isprint
function
fn(c : int) -> int
Parameters
| Name | Type | Notes |
|---|---|---|
c | int |
Returns: int
ispunct
function
fn(c : int) -> int
Parameters
| Name | Type | Notes |
|---|---|---|
c | int |
Returns: int
isspace
function
fn(c : int) -> int
Parameters
| Name | Type | Notes |
|---|---|---|
c | int |
Returns: int
isupper
function
fn(c : int) -> int
Parameters
| Name | Type | Notes |
|---|---|---|
c | int |
Returns: int
isxdigit
function
fn(c : int) -> int
Parameters
| Name | Type | Notes |
|---|---|---|
c | int |
Returns: int
tolower
function
fn(c : int) -> int
Parameters
| Name | Type | Notes |
|---|---|---|
c | int |
Returns: int
toupper
function
fn(c : int) -> int
Parameters
| Name | Type | Notes |
|---|---|---|
c | int |
Returns: int