2.5 Character Literals

25
Dec

Character Literals

1 [A character_literal is formed by enclosing a graphic character between two apostrophe characters.]

Syntax

2 character_literal ::= 'graphic_character'

NOTES

3 [5]  A character_literal is an enumeration literal of a character type. See §3.5.2.

Examples

4 Examples of character literals: 

5/2

'A'     '*'     '''     ' '
'L'     'Л'     'Λ'    -- Various els.
'∞'     'א'            -- Big numbers - infinity and aleph.

Wording Changes from Ada 83

5.a The definitions of the values of literals are in Sections 3 and 4, rather than here, since it requires knowledge of types.

[aada]

Alexis Ada

Note that the Alexis Ada compiler considers all characters as UTF-8 characters. There is no CHAR, WIDE_CHAR, or WIDE_WIDE_CHAR per se. Instead, a character literal may fit, or not, the CHAR, WIDE_CHAR and WIDE_WIDE_CHAR types.

[/aada]