3
@node Characters, Conses, Numbers (Numbers), Top
8
* Characters Dictionary::
11
@node Character Concepts, Characters Dictionary, Characters, Characters
12
@section Character Concepts
14
@c including concept-characters
17
* Introduction to Characters::
18
* Introduction to Scripts and Repertoires::
19
* Character Attributes::
20
* Character Categories::
21
* Identity of Characters::
22
* Ordering of Characters::
24
* Treatment of Newline during Input and Output::
25
* Character Encodings::
26
* Documentation of Implementation-Defined Scripts::
29
@node Introduction to Characters, Introduction to Scripts and Repertoires, Character Concepts, Character Concepts
30
@subsection Introduction to Characters
34
is an @i{object} that represents a unitary token
35
(@i{e.g.}, a letter, a special symbol, or a ``control character'')
36
in an aggregate quantity of text
37
(@i{e.g.}, a @i{string} or a text @i{stream}).
39
@r{Common Lisp} allows an implementation to provide support
40
for international language @i{characters} as well
41
as @i{characters} used in specialized arenas (@i{e.g.}, mathematics).
43
The following figures contain lists of @i{defined names} applicable to
46
Figure 13--1 lists some @i{defined names} relating to
47
@i{character} @i{attributes} and @i{character} @i{predicates}.
52
@w{ alpha-char-p char-not-equal char> }
53
@w{ alphanumericp char-not-greaterp char>= }
54
@w{ both-case-p char-not-lessp digit-char-p }
55
@w{ char-code-limit char/= graphic-char-p }
56
@w{ char-equal char< lower-case-p }
57
@w{ char-greaterp char<= standard-char-p }
58
@w{ char-lessp char= upper-case-p }
61
@w{ Figure 13--1: Character defined names -- 1 }
66
Figure 13--2 lists some @i{character} construction and conversion @i{defined names}.
71
@w{ char-code char-name code-char }
72
@w{ char-downcase char-upcase digit-char }
73
@w{ char-int character name-char }
76
@w{ Figure 13--2: Character defined names -- 2}
81
@node Introduction to Scripts and Repertoires, Character Attributes, Introduction to Characters, Character Concepts
82
@subsection Introduction to Scripts and Repertoires
86
* Character Repertoires::
89
@node Character Scripts, Character Repertoires, Introduction to Scripts and Repertoires, Introduction to Scripts and Repertoires
90
@subsubsection Character Scripts
92
A @i{script} is one of possibly several sets that form an @i{exhaustive partition}
93
of the type @b{character}.
95
The number of such sets and boundaries between them is @i{implementation-defined}.
96
@r{Common Lisp} does not require these sets to be @i{types}, but an @i{implementation}
97
is permitted to define such @i{types} as an extension. Since no @i{character}
98
from one @i{script} can ever be a member of another @i{script}, it is generally
99
more useful to speak about @i{character} @i{repertoires}.
102
the term ``@i{script}'' is chosen for
104
compatibility with ISO terminology, no @i{conforming implementation}
105
is required to use any particular @i{scripts} standardized by ISO
106
or by any other standards organization.
108
Whether and how the @i{script} or @i{scripts} used by any given
109
@i{implementation} are named is @i{implementation-dependent}.
111
@node Character Repertoires, , Character Scripts, Introduction to Scripts and Repertoires
112
@subsubsection Character Repertoires
116
is a @i{type specifier} for a @i{subtype} of @i{type} @b{character}.
118
This term is generally used when describing a collection of @i{characters}
119
independent of their coding.
120
@i{Characters} in @i{repertoires} are only identified
123
by character description.
125
A @i{repertoire} can contain @i{characters} from several
126
@i{scripts}, and a @i{character} can appear in more than
129
For some examples of @i{repertoires}, see the coded character standards
130
ISO 8859/1, ISO 8859/2, and ISO 6937/2.
131
Note, however, that although
132
the term ``@i{repertoire}'' is chosen for
134
compatibility with ISO terminology, no @i{conforming implementation}
135
is required to use @i{repertoires} standardized by ISO or any other
136
standards organization.
138
@node Character Attributes, Character Categories, Introduction to Scripts and Repertoires, Character Concepts
139
@subsection Character Attributes
141
@i{Characters} have only one @i{standardized} @i{attribute}:
142
a @i{code}. A @i{character}'s @i{code} is a non-negative @i{integer}.
143
This @i{code} is composed from a character @i{script} and a character label
144
in an @i{implementation-dependent} way. See the @i{functions} @b{char-code} and @b{code-char}.
146
Additional, @i{implementation-defined} @i{attributes} of @i{characters}
148
so that, for example,
149
two @i{characters} with the same @i{code} may differ
150
in some other, @i{implementation-defined} way.
152
For any @i{implementation-defined} @i{attribute}
153
there is a distinguished value
156
value for that @i{attribute}.
157
A @i{character} for which each @i{implementation-defined} @i{attribute}
158
has the null value for that @i{attribute} is called a @i{simple} @i{character}.
159
If the @i{implementation} has no @i{implementation-defined} @i{attributes},
160
then all @i{characters} are @i{simple} @i{characters}.
162
@node Character Categories, Identity of Characters, Character Attributes, Character Concepts
163
@subsection Character Categories
165
There are several (overlapping) categories of @i{characters} that have no formally
166
associated @i{type} but that are nevertheless useful to name.
168
@i{graphic} @i{characters},
169
@i{alphabetic}_1 @i{characters},
170
@i{characters} with @i{case}
171
(@i{uppercase} and @i{lowercase} @i{characters}),
172
@i{numeric} @i{characters},
173
@i{alphanumeric} @i{characters},
174
and @i{digits} (in a given @i{radix}).
176
For each @i{implementation-defined} @i{attribute} of a @i{character},
177
the documentation for that @i{implementation} must specify whether
178
@i{characters} that differ only in that @i{attribute} are permitted to differ
179
in whether are not they are members of one of the aforementioned categories.
181
Note that these terms are defined independently of any special syntax
182
which might have been enabled in the @i{current readtable}.
185
* Graphic Characters::
186
* Alphabetic Characters::
187
* Characters With Case::
188
* Uppercase Characters::
189
* Lowercase Characters::
190
* Corresponding Characters in the Other Case::
191
* Case of Implementation-Defined Characters::
192
* Numeric Characters::
193
* Alphanumeric Characters::
194
* Digits in a Radix::
197
@node Graphic Characters, Alphabetic Characters, Character Categories, Character Categories
198
@subsubsection Graphic Characters
200
@i{Characters} that are classified as @i{graphic}
202
, or displayable, are each
203
associated with a glyph, a visual representation of the @i{character}.
205
A @i{graphic} @i{character} is one that has a standard textual
206
representation as a single @i{glyph}, such as @t{A} or @t{*} or @t{=}.
207
@i{Space}, which effectively has a blank @i{glyph}, is defined
210
Of the @i{standard characters},
211
@i{newline} is @i{non-graphic}
212
and all others are @i{graphic}; see @ref{Standard Characters}.
214
@i{Characters} that are not @i{graphic} are called @i{non-graphic}
215
@IGindex{non-graphic}
218
@i{Non-graphic} @i{characters} are sometimes informally called
219
``formatting characters''
220
or ``control characters.''
228
if they are supported by the @i{implementation},
231
@node Alphabetic Characters, Characters With Case, Graphic Characters, Character Categories
232
@subsubsection Alphabetic Characters
234
The @i{alphabetic}_1 @i{characters} are
235
a subset of the @i{graphic} @i{characters}.
236
Of the @i{standard characters}, only these are the @i{alphabetic}_1 @i{characters}:
238
@t{A B C D E F G H I J K L M N O P Q R S T U V W X Y Z}
240
@t{a b c d e f g h i j k l m n o p q r s t u v w x y z}
242
Any @i{implementation-defined} @i{character} that has @i{case}
243
must be @i{alphabetic}_1.
244
For each @i{implementation-defined} @i{graphic} @i{character}
245
that has no @i{case},
246
it is @i{implementation-defined} whether
247
that @i{character} is @i{alphabetic}_1.
249
@node Characters With Case, Uppercase Characters, Alphabetic Characters, Character Categories
250
@subsubsection Characters With Case
252
The @i{characters} with @i{case} are
253
a subset of the @i{alphabetic}_1 @i{characters}.
254
A @i{character} with @i{case} has the property of being either
255
@i{uppercase} or @i{lowercase}.
256
Every @i{character} with @i{case} is in one-to-one correspondence
257
with some other @i{character} with the opposite @i{case}.
259
@node Uppercase Characters, Lowercase Characters, Characters With Case, Character Categories
260
@subsubsection Uppercase Characters
262
An uppercase @i{character} is one that has a corresponding
263
@i{lowercase} @i{character} that is @i{different}
264
(and can be obtained using @b{char-downcase}).
266
Of the @i{standard characters}, only these are @i{uppercase} @i{characters}:
268
@t{A B C D E F G H I J K L M N O P Q R S T U V W X Y Z}
270
@node Lowercase Characters, Corresponding Characters in the Other Case, Uppercase Characters, Character Categories
271
@subsubsection Lowercase Characters
273
A lowercase @i{character} is one that has a corresponding
274
@i{uppercase} @i{character} that is @i{different}
275
(and can be obtained using @b{char-upcase}).
277
Of the @i{standard characters}, only these are @i{lowercase} @i{characters}:
279
@t{a b c d e f g h i j k l m n o p q r s t u v w x y z}
281
@node Corresponding Characters in the Other Case, Case of Implementation-Defined Characters, Lowercase Characters, Character Categories
282
@subsubsection Corresponding Characters in the Other Case
284
The @i{uppercase} @i{standard characters} @t{A} through @t{Z} mentioned above
285
respectively correspond to
286
the @i{lowercase} @i{standard characters} @t{a} through @t{z} mentioned above.
287
For example, the @i{uppercase} @i{character} @t{E}
288
corresponds to the @i{lowercase} @i{character} @t{e}, and vice versa.
290
@node Case of Implementation-Defined Characters, Numeric Characters, Corresponding Characters in the Other Case, Character Categories
291
@subsubsection Case of Implementation-Defined Characters
293
An @i{implementation} may define that other @i{implementation-defined}
294
@i{graphic} @i{characters} have @i{case}. Such definitions must always
295
be done in pairs---one @i{uppercase} @i{character} in one-to-one
296
@i{correspondence} with one @i{lowercase} @i{character}.
298
@node Numeric Characters, Alphanumeric Characters, Case of Implementation-Defined Characters, Character Categories
299
@subsubsection Numeric Characters
301
The @i{numeric} @i{characters} are
302
a subset of the @i{graphic} @i{characters}.
303
Of the @i{standard characters}, only these are @i{numeric} @i{characters}:
305
@t{0 1 2 3 4 5 6 7 8 9}
307
For each @i{implementation-defined} @i{graphic} @i{character}
308
that has no @i{case}, the @i{implementation} must define whether
309
or not it is a @i{numeric} @i{character}.
311
@node Alphanumeric Characters, Digits in a Radix, Numeric Characters, Character Categories
312
@subsubsection Alphanumeric Characters
314
The set of @i{alphanumeric} @i{characters} is the union of
315
the set of @i{alphabetic}_1 @i{characters}
316
and the set of @i{numeric} @i{characters}.
318
@node Digits in a Radix, , Alphanumeric Characters, Character Categories
319
@subsubsection Digits in a Radix
321
What qualifies as a @i{digit} depends on the @i{radix}
322
(an @i{integer} between @t{2} and @t{36}, inclusive).
323
The potential @i{digits} are:
325
@t{0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z}
327
Their respective weights are @t{0}, @t{1}, @t{2}, ... @t{35}.
328
In any given radix n, only the first n potential @i{digits}
329
are considered to be @i{digits}.
331
the digits in radix @t{2} are @t{0} and @t{1},
332
the digits in radix @t{10} are @t{0} through @t{9}, and
333
the digits in radix @t{16} are @t{0} through @t{F}.
335
@i{Case} is not significant in @i{digits};
336
for example, in radix @t{16}, both @t{F} and @t{f}
337
are @i{digits} with weight @t{15}.
339
@node Identity of Characters, Ordering of Characters, Character Categories, Character Concepts
340
@subsection Identity of Characters
342
Two @i{characters} that are @b{eql}, @b{char=}, or @b{char-equal}
343
are not necessarily @b{eq}.
345
@node Ordering of Characters, Character Names, Identity of Characters, Character Concepts
346
@subsection Ordering of Characters
348
The total ordering on @i{characters} is guaranteed to have
349
the following properties:
354
If two @i{characters} have the same @i{implementation-defined} @i{attributes},
355
then their ordering by @b{char<} is consistent with the numerical
356
ordering by the predicate @b{<} on their code @i{attributes}.
359
If two @i{characters} differ in any @i{attribute}, then they
362
[Reviewer Note by Barmar: I wonder if we should say that the ordering may be dependent on the
363
@i{implementation-defined} @i{attributes}.]
366
The total ordering is not necessarily the same as the total ordering
367
on the @i{integers} produced by applying @b{char-int} to the
371
While @i{alphabetic}_1 @i{standard characters} of a given @i{case}
373
obey a partial ordering,
374
they need not be contiguous; it is permissible for
375
@i{uppercase} and @i{lowercase} @i{characters} to be interleaved.
376
Thus @t{(char<= #\a x #\z)}
377
is not a valid way of determining whether or not @t{x} is a
378
@i{lowercase} @i{character}.
382
Of the @i{standard characters},
383
those which are @i{alphanumeric} obey the following partial ordering:
386
A<B<C<D<E<F<G<H<I<J<K<L<M<N<O<P<Q<R<S<T<U<V<W<X<Y<Z
387
a<b<c<d<e<f<g<h<i<j<k<l<m<n<o<p<q<r<s<t<u<v<w<x<y<z
393
This implies that, for @i{standard characters}, @i{alphabetic}_1
394
ordering holds within each @i{case} (@i{uppercase} and @i{lowercase}),
395
and that the @i{numeric} @i{characters} as a group are not interleaved
396
with @i{alphabetic} @i{characters}.
397
However, the ordering or possible interleaving of @i{uppercase} @i{characters}
398
and @i{lowercase} @i{characters} is @i{implementation-defined}.
400
@node Character Names, Treatment of Newline during Input and Output, Ordering of Characters, Character Concepts
401
@subsection Character Names
403
The following @i{character} @i{names} must be present in all
404
@i{conforming implementations}:
409
The character that represents the division between lines.
410
An implementation must translate between @t{#\Newline},
411
a single-character representation, and whatever external representation(s)
415
The space or blank character.
418
The following names are @i{semi-standard};
419
if an @i{implementation} supports them,
420
they should be used for the described @i{characters} and no others.
425
The rubout or delete character.
428
The form-feed or page-separator character.
431
The tabulate character.
434
The backspace character.
437
The carriage return character.
440
The line-feed character.
443
In some @i{implementations},
444
one or more of these @i{character} @i{names}
445
might denote a @i{standard character};
447
@t{#\Linefeed} and @t{#\Newline} might be the @i{same} @i{character}
448
in some @i{implementations}.
450
@node Treatment of Newline during Input and Output, Character Encodings, Character Names, Character Concepts
451
@subsection Treatment of Newline during Input and Output
453
When the character @t{#\Newline} is written to an output file,
454
the implementation must take the appropriate action
455
to produce a line division. This might involve writing out a
456
record or translating @t{#\Newline} to a CR/LF sequence.
457
When reading, a corresponding reverse transformation must take place.
459
@node Character Encodings, Documentation of Implementation-Defined Scripts, Treatment of Newline during Input and Output, Character Concepts
460
@subsection Character Encodings
462
A @i{character} is sometimes represented merely by its @i{code}, and sometimes
463
by another @i{integer} value which is composed from the @i{code} and all
464
@i{implementation-defined} @i{attributes}
465
(in an @i{implementation-defined} way
466
that might vary between @i{Lisp images} even in the same @i{implementation}).
467
This @i{integer}, returned by the function @b{char-int}, is called the
468
character's ``encoding.''
469
There is no corresponding function
470
from a character's encoding back to the @i{character},
471
since its primary intended uses include things like hashing where an inverse operation
472
is not really called for.
474
@node Documentation of Implementation-Defined Scripts, , Character Encodings, Character Concepts
475
@subsection Documentation of Implementation-Defined Scripts
477
An @i{implementation} must document the @i{character} @i{scripts}
478
it supports. For each @i{character} @i{script} supported,
479
the documentation must describe at least the following:
483
Character labels, glyphs, and descriptions.
484
Character labels must be uniquely named using only Latin capital letters A--Z,
485
hyphen (-), and digits 0--9.
487
Reader canonicalization.
488
Any mechanisms by which @b{read} treats
489
@i{different} characters as equivalent must be documented.
491
The impact on @b{char-upcase},
493
and the case-sensitive @i{format directives}.
494
In particular, for each @i{character} with @i{case},
495
whether it is @i{uppercase} or @i{lowercase},
496
and which @i{character} is its equivalent in the opposite case.
498
The behavior of the case-insensitive @i{functions}
499
@b{char-equal}, @b{char-not-equal},
500
@b{char-lessp}, @b{char-greaterp},
501
@b{char-not-greaterp}, and @b{char-not-lessp}.
503
The behavior of any @i{character} @i{predicates};
504
in particular, the effects of
513
The interaction with file I/O, in particular,
514
the supported coded character sets (for example, ISO8859/1-1987)
515
and external encoding schemes supported are documented.
518
@c end of including concept-characters
520
@node Characters Dictionary, , Character Concepts, Characters
521
@section Characters Dictionary
523
@c including dict-characters
526
* character (System Class)::
549
@node character (System Class), base-char, Characters Dictionary, Characters Dictionary
550
@subsection character [System Class]
552
@subsubheading Class Precedence List::
556
@subsubheading Description::
558
A @i{character} is an @i{object} that
559
represents a unitary token in an aggregate quantity of text;
560
see @ref{Character Concepts}.
562
The @i{types} @b{base-char} and @b{extended-char}
563
form an @i{exhaustive partition} of the @i{type} @b{character}.
565
@subsubheading See Also::
567
@ref{Character Concepts},
568
@ref{Sharpsign Backslash},
569
@ref{Printing Characters}
571
@node base-char, standard-char, character (System Class), Characters Dictionary
572
@subsection base-char [Type]
574
@subsubheading Supertypes::
580
@subsubheading Description::
582
The @i{type} @b{base-char} is defined as the @i{upgraded array element type}
583
of @b{standard-char}.
584
An @i{implementation} can support additional @i{subtypes} of @i{type} @b{character}
585
(besides the ones listed in this standard)
586
that might or might not be @i{supertypes} of @i{type} @b{base-char}.
587
In addition, an @i{implementation} can define @b{base-char}
588
to be the @i{same} @i{type} as @b{character}.
590
@i{Base characters} are distinguished in the following respects:
594
The @i{type} @b{standard-char} is a @i{subrepertoire} of the @i{type} @b{base-char}.
596
The selection of @i{base characters} that are not @i{standard characters}
597
is implementation defined.
599
Only @i{objects} of the @i{type} @b{base-char} can be
600
@i{elements} of a @i{base string}.
602
No upper bound is specified for the number of characters in the
603
@b{base-char} @i{repertoire}; the size of that @i{repertoire}
605
@i{implementation-defined}.
606
The lower bound is~96, the number of @i{standard characters}.
609
Whether a character is a @i{base character} depends on the way
610
that an @i{implementation} represents @i{strings},
611
and not any other properties of the @i{implementation} or the host operating system.
612
For example, one implementation might encode all @i{strings}
613
as characters having 16-bit encodings, and another might have
614
two kinds of @i{strings}: those with characters having 8-bit
615
encodings and those with characters having 16-bit encodings. In the
616
first @i{implementation}, the @i{type} @b{base-char} is equivalent to
617
the @i{type} @b{character}: there is only one kind of @i{string}.
618
In the second @i{implementation}, the @i{base characters} might be
619
those @i{characters} that could be stored in a @i{string} of @i{characters}
620
having 8-bit encodings. In such an implementation,
621
the @i{type} @b{base-char} is a @i{proper subtype} of the @i{type} @b{character}.
623
The @i{type} @b{standard-char} is a
625
@i{subtype} of @i{type} @b{base-char}.
627
@node standard-char, extended-char, base-char, Characters Dictionary
628
@subsection standard-char [Type]
630
@subsubheading Supertypes::
639
@subsubheading Description::
641
A fixed set of 96 @i{characters} required to be present in all
642
@i{conforming implementations}. @i{Standard characters} are
643
defined in @ref{Standard Characters}.
645
Any @i{character} that is not @i{simple} is not a @i{standard character}.
647
@subsubheading See Also::
649
@ref{Standard Characters}
651
@node extended-char, char=, standard-char, Characters Dictionary
652
@subsection extended-char [Type]
654
@subsubheading Supertypes::
660
@subsubheading Description::
662
The @i{type} @b{extended-char} is equivalent to the @i{type} @t{(and character (not base-char))}.
664
@subsubheading Notes::
666
The @i{type} @b{extended-char} might
667
have no @i{elements}_4
668
in @i{implementations} in which all @i{characters} are of @i{type} @b{base-char}.
670
@node char=, character, extended-char, Characters Dictionary
671
@subsection char=, char/=, char<, char>, char<=, char>=,
672
@subheading char-equal, char-not-equal, char-lessp, char-greaterp, char-not-greaterp,
673
@subheading char-not-lessp
678
@code{@r{char=}} @i{@r{&rest} characters^+} @result{} @i{generalized-boolean}
680
@code{@r{char/=}} @i{@r{&rest} characters^+} @result{} @i{generalized-boolean}
682
@code{@r{char<}} @i{@r{&rest} characters^+} @result{} @i{generalized-boolean}
684
@code{@r{char>}} @i{@r{&rest} characters^+} @result{} @i{generalized-boolean}
686
@code{@r{char<=}} @i{@r{&rest} characters^+} @result{} @i{generalized-boolean}
688
@code{@r{char>=}} @i{@r{&rest} characters^+} @result{} @i{generalized-boolean}
690
@code{char-equal} @i{@r{&rest} characters^+} @result{} @i{generalized-boolean}
692
@code{char-not-equal} @i{@r{&rest} characters^+} @result{} @i{generalized-boolean}
694
@code{char-lessp} @i{@r{&rest} characters^+} @result{} @i{generalized-boolean}
696
@code{char-greaterp} @i{@r{&rest} characters^+} @result{} @i{generalized-boolean}
698
@code{char-not-greaterp} @i{@r{&rest} characters^+} @result{} @i{generalized-boolean}
700
@code{char-not-lessp} @i{@r{&rest} characters^+} @result{} @i{generalized-boolean}
702
@subsubheading Arguments and Values::
704
@i{character}---a @i{character}.
706
@i{generalized-boolean}---a @i{generalized boolean}.
708
@subsubheading Description::
710
These predicates compare @i{characters}.
712
@b{char=} returns @i{true} if all @i{characters} are the @i{same};
713
otherwise, it returns @i{false}.
715
If two @i{characters} differ
716
in any @i{implementation-defined} @i{attributes},
717
then they are not @b{char=}.
719
@b{char/=} returns @i{true} if all @i{characters} are different;
720
otherwise, it returns @i{false}.
722
@b{char<} returns @i{true} if the @i{characters} are monotonically increasing;
723
otherwise, it returns @i{false}.
725
If two @i{characters}
726
have @i{identical} @i{implementation-defined} @i{attributes},
727
then their ordering by @b{char<} is
728
consistent with the numerical ordering by the predicate @t{<} on their @i{codes}.
730
@b{char>} returns @i{true} if the @i{characters} are monotonically decreasing;
731
otherwise, it returns @i{false}.
733
If two @i{characters} have
734
@i{identical} @i{implementation-defined} @i{attributes},
735
then their ordering by @b{char>} is
736
consistent with the numerical ordering by the predicate @t{>} on their @i{codes}.
738
@b{char<=} returns @i{true}
739
if the @i{characters} are monotonically nondecreasing;
740
otherwise, it returns @i{false}.
742
If two @i{characters} have
743
@i{identical} @i{implementation-defined} @i{attributes},
744
then their ordering by @b{char<=} is
745
consistent with the numerical ordering by the predicate @t{<=} on their @i{codes}.
747
@b{char>=} returns @i{true}
748
if the @i{characters} are monotonically nonincreasing;
749
otherwise, it returns @i{false}.
751
If two @i{characters} have
752
@i{identical} @i{implementation-defined} @i{attributes},
753
then their ordering by @b{char>=} is
754
consistent with the numerical ordering by the predicate @t{>=} on their @i{codes}.
760
@b{char-not-greaterp},
761
and @b{char-not-lessp}
770
except that they ignore differences in @i{case} and
772
might have an @i{implementation-defined} behavior
773
for @i{non-simple} @i{characters}.
774
For example, an @i{implementation} might define that
775
@b{char-equal}, @i{etc.} ignore certain
776
@i{implementation-defined} @i{attributes}.
778
of each @i{implementation-defined} @i{attribute}
779
upon these functions must be specified as part of the definition of that @i{attribute}.
781
@subsubheading Examples::
784
(char= #\d #\d) @result{} @i{true}
785
(char= #\A #\a) @result{} @i{false}
786
(char= #\d #\x) @result{} @i{false}
787
(char= #\d #\D) @result{} @i{false}
788
(char/= #\d #\d) @result{} @i{false}
789
(char/= #\d #\x) @result{} @i{true}
790
(char/= #\d #\D) @result{} @i{true}
791
(char= #\d #\d #\d #\d) @result{} @i{true}
792
(char/= #\d #\d #\d #\d) @result{} @i{false}
793
(char= #\d #\d #\x #\d) @result{} @i{false}
794
(char/= #\d #\d #\x #\d) @result{} @i{false}
795
(char= #\d #\y #\x #\c) @result{} @i{false}
796
(char/= #\d #\y #\x #\c) @result{} @i{true}
797
(char= #\d #\c #\d) @result{} @i{false}
798
(char/= #\d #\c #\d) @result{} @i{false}
799
(char< #\d #\x) @result{} @i{true}
800
(char<= #\d #\x) @result{} @i{true}
801
(char< #\d #\d) @result{} @i{false}
802
(char<= #\d #\d) @result{} @i{true}
803
(char< #\a #\e #\y #\z) @result{} @i{true}
804
(char<= #\a #\e #\y #\z) @result{} @i{true}
805
(char< #\a #\e #\e #\y) @result{} @i{false}
806
(char<= #\a #\e #\e #\y) @result{} @i{true}
807
(char> #\e #\d) @result{} @i{true}
808
(char>= #\e #\d) @result{} @i{true}
809
(char> #\d #\c #\b #\a) @result{} @i{true}
810
(char>= #\d #\c #\b #\a) @result{} @i{true}
811
(char> #\d #\d #\c #\a) @result{} @i{false}
812
(char>= #\d #\d #\c #\a) @result{} @i{true}
813
(char> #\e #\d #\b #\c #\a) @result{} @i{false}
814
(char>= #\e #\d #\b #\c #\a) @result{} @i{false}
815
(char> #\z #\A) @result{} @i{implementation-dependent}
816
(char> #\Z #\a) @result{} @i{implementation-dependent}
817
(char-equal #\A #\a) @result{} @i{true}
818
(stable-sort (list #\b #\A #\B #\a #\c #\C) #'char-lessp)
819
@result{} (#\A #\a #\b #\B #\c #\C)
820
(stable-sort (list #\b #\A #\B #\a #\c #\C) #'char<)
821
@result{} (#\A #\B #\C #\a #\b #\c) ;Implementation A
822
@result{} (#\a #\b #\c #\A #\B #\C) ;Implementation B
823
@result{} (#\a #\A #\b #\B #\c #\C) ;Implementation C
824
@result{} (#\A #\a #\B #\b #\C #\c) ;Implementation D
825
@result{} (#\A #\B #\a #\b #\C #\c) ;Implementation E
828
@subsubheading Exceptional Situations::
830
Should signal an error of @i{type} @b{program-error}
831
if at least one @i{character} is not supplied.
833
@subsubheading See Also::
835
@ref{Character Syntax},
836
@ref{Documentation of Implementation-Defined Scripts}
838
@subsubheading Notes::
840
If characters differ in their @i{code} @i{attribute}
841
or any @i{implementation-defined} @i{attribute},
842
they are considered to be different by @b{char=}.
844
There is no requirement that @t{(eq c1 c2)} be true merely because
845
@t{(char= c1 c2)} is @i{true}. While @b{eq} can distinguish two
847
that @b{char=} does not, it is distinguishing them not
848
as @i{characters}, but in some sense on the basis of a lower level
849
implementation characteristic.
850
If @t{(eq c1 c2)} is @i{true},
851
then @t{(char= c1 c2)} is also true.
852
@b{eql} and @b{equal}
853
compare @i{characters} in the same
854
way that @b{char=} does.
856
The manner in which @i{case} is used by
861
@b{char-not-greaterp},
862
and @b{char-not-lessp}
863
implies an ordering for @i{standard characters} such that
864
@t{A=a}, @t{B=b}, and so on, up to @t{Z=z}, and furthermore either
867
@node character, characterp, char=, Characters Dictionary
868
@subsection character [Function]
870
@code{character} @i{character} @result{} @i{denoted-character}
872
@subsubheading Arguments and Values::
874
@i{character}---a @i{character designator}.
876
@i{denoted-character}---a @i{character}.
878
@subsubheading Description::
880
Returns the @i{character} denoted by the @i{character} @i{designator}.
882
@subsubheading Examples::
885
(character #\a) @result{} #\a
886
(character "a") @result{} #\a
887
(character 'a) @result{} #\A
888
(character '\a) @result{} #\a
889
(character 65.) is an error.
890
(character 'apple) is an error.
893
@subsubheading Exceptional Situations::
895
Should signal an error of @i{type} @b{type-error}
896
if @i{object} is not a @i{character designator}.
898
@subsubheading See Also::
902
@subsubheading Notes::
905
(character @i{object}) @equiv{} (coerce @i{object} 'character)
908
@node characterp, alpha-char-p, character, Characters Dictionary
909
@subsection characterp [Function]
911
@code{characterp} @i{object} @result{} @i{generalized-boolean}
913
@subsubheading Arguments and Values::
915
@i{object}---an @i{object}.
917
@i{generalized-boolean}---a @i{generalized boolean}.
919
@subsubheading Description::
921
Returns @i{true} if @i{object} is of @i{type} @b{character};
922
otherwise, returns @i{false}.
924
@subsubheading Examples::
927
(characterp #\a) @result{} @i{true}
928
(characterp 'a) @result{} @i{false}
929
(characterp "a") @result{} @i{false}
930
(characterp 65.) @result{} @i{false}
931
(characterp #\Newline) @result{} @i{true}
932
;; This next example presupposes an implementation
933
;; in which #\Rubout is an implementation-defined character.
934
(characterp #\Rubout) @result{} @i{true}
937
@subsubheading See Also::
940
(@i{type} and @i{function}),
943
@subsubheading Notes::
946
(characterp @i{object}) @equiv{} (typep @i{object} 'character)
949
@node alpha-char-p, alphanumericp, characterp, Characters Dictionary
950
@subsection alpha-char-p [Function]
952
@code{alpha-char-p} @i{character} @result{} @i{generalized-boolean}
954
@subsubheading Arguments and Values::
956
@i{character}---a @i{character}.
958
@i{generalized-boolean}---a @i{generalized boolean}.
960
@subsubheading Description::
962
Returns @i{true} if @i{character} is an @i{alphabetic}_1 @i{character};
963
otherwise, returns @i{false}.
965
@subsubheading Examples::
968
(alpha-char-p #\a) @result{} @i{true}
969
(alpha-char-p #\5) @result{} @i{false}
970
(alpha-char-p #\Newline) @result{} @i{false}
971
;; This next example presupposes an implementation
972
;; in which #\\alpha is a defined character.
973
(alpha-char-p #\\alpha) @result{} @i{implementation-dependent}
976
@subsubheading Affected By::
979
(In particular, the results of this predicate are independent
980
of any special syntax which might have been enabled in the @i{current readtable}.)
982
@subsubheading Exceptional Situations::
984
Should signal an error of @i{type} @b{type-error}
985
if @i{character} is not a @i{character}.
987
@subsubheading See Also::
991
@ref{Documentation of Implementation-Defined Scripts}
993
@node alphanumericp, digit-char, alpha-char-p, Characters Dictionary
994
@subsection alphanumericp [Function]
996
@code{alphanumericp} @i{character} @result{} @i{generalized-boolean}
998
@subsubheading Arguments and Values::
1000
@i{character}---a @i{character}.
1002
@i{generalized-boolean}---a @i{generalized boolean}.
1004
@subsubheading Description::
1006
Returns @i{true} if @i{character} is an @i{alphabetic}_1 @i{character}
1007
or a @i{numeric} @i{character};
1008
otherwise, returns @i{false}.
1010
@subsubheading Examples::
1013
(alphanumericp #\Z) @result{} @i{true}
1014
(alphanumericp #\9) @result{} @i{true}
1015
(alphanumericp #\Newline) @result{} @i{false}
1016
(alphanumericp #\#) @result{} @i{false}
1019
@subsubheading Affected By::
1022
(In particular, the results of this predicate are independent
1023
of any special syntax which might have been enabled in the @i{current readtable}.)
1025
@subsubheading Exceptional Situations::
1027
Should signal an error of @i{type} @b{type-error}
1028
if @i{character} is not a @i{character}.
1030
@subsubheading See Also::
1034
@ref{graphic-char-p}
1038
@subsubheading Notes::
1040
Alphanumeric characters are graphic
1041
as defined by @b{graphic-char-p}.
1042
The alphanumeric characters are a subset of the graphic characters.
1043
The standard characters @t{A} through @t{Z},
1044
@t{a} through @t{z},
1045
and @t{0} through @t{9} are alphanumeric characters.
1049
@equiv{} (or (alpha-char-p x) (not (null (digit-char-p x))))
1052
@node digit-char, digit-char-p, alphanumericp, Characters Dictionary
1053
@subsection digit-char [Function]
1055
@code{digit-char} @i{weight @r{&optional} radix} @result{} @i{char}
1057
@subsubheading Arguments and Values::
1059
@i{weight}---a non-negative @i{integer}.
1061
@i{radix}---a @i{radix}.
1062
The default is @t{10}.
1064
@i{char}---a @i{character} or @i{false}.
1066
@subsubheading Description::
1068
If @i{weight} is less than @i{radix},
1069
@b{digit-char} returns a @i{character} which has that @i{weight}
1070
when considered as a digit in the specified radix.
1071
If the resulting @i{character} is to be an @i{alphabetic}_1 @i{character},
1072
it will be an uppercase @i{character}.
1074
If @i{weight} is greater than or equal to @i{radix},
1075
@b{digit-char} returns @i{false}.
1077
@subsubheading Examples::
1080
(digit-char 0) @result{} #\0
1081
(digit-char 10 11) @result{} #\A
1082
(digit-char 10 10) @result{} @i{false}
1083
(digit-char 7) @result{} #\7
1084
(digit-char 12) @result{} @i{false}
1085
(digit-char 12 16) @result{} #\C ;not #\c
1086
(digit-char 6 2) @result{} @i{false}
1087
(digit-char 1 2) @result{} #\1
1090
@subsubheading See Also::
1094
@ref{graphic-char-p}
1096
@ref{Character Syntax}
1098
@subsubheading Notes::
1100
@node digit-char-p, graphic-char-p, digit-char, Characters Dictionary
1101
@subsection digit-char-p [Function]
1103
@code{digit-char-p} @i{char @r{&optional} radix} @result{} @i{weight}
1105
@subsubheading Arguments and Values::
1107
@i{char}---a @i{character}.
1109
@i{radix}---a @i{radix}.
1110
The default is @t{10}.
1112
@i{weight}---either a non-negative @i{integer} less than @i{radix},
1115
@subsubheading Description::
1117
Tests whether @i{char} is a digit in the specified @i{radix}
1118
(@i{i.e.}, with a weight less than @i{radix}).
1119
If it is a digit in that @i{radix},
1120
its weight is returned as an @i{integer};
1121
otherwise @b{nil} is returned.
1123
@subsubheading Examples::
1126
(digit-char-p #\5) @result{} 5
1127
(digit-char-p #\5 2) @result{} @i{false}
1128
(digit-char-p #\A) @result{} @i{false}
1129
(digit-char-p #\a) @result{} @i{false}
1130
(digit-char-p #\A 11) @result{} 10
1131
(digit-char-p #\a 11) @result{} 10
1132
(mapcar #'(lambda (radix)
1133
(map 'list #'(lambda (x) (digit-char-p x radix))
1136
@result{} ((0 NIL NIL NIL NIL NIL NIL NIL)
1137
(0 5 NIL NIL NIL NIL NIL NIL)
1138
(0 5 9 NIL NIL NIL NIL NIL)
1139
(0 5 9 10 10 15 NIL NIL)
1140
(0 5 9 10 10 15 16 35))
1143
@subsubheading Affected By::
1146
(In particular, the results of this predicate are independent
1147
of any special syntax which might have been enabled in the @i{current readtable}.)
1149
@subsubheading See Also::
1153
@subsubheading Notes::
1155
Digits are @i{graphic} @i{characters}.
1157
@node graphic-char-p, standard-char-p, digit-char-p, Characters Dictionary
1158
@subsection graphic-char-p [Function]
1160
@code{graphic-char-p} @i{char} @result{} @i{generalized-boolean}
1162
@subsubheading Arguments and Values::
1164
@i{char}---a @i{character}.
1166
@i{generalized-boolean}---a @i{generalized boolean}.
1168
@subsubheading Description::
1170
Returns @i{true} if @i{character} is a @i{graphic} @i{character};
1171
otherwise, returns @i{false}.
1173
@subsubheading Examples::
1176
(graphic-char-p #\G) @result{} @i{true}
1177
(graphic-char-p #\#) @result{} @i{true}
1178
(graphic-char-p #\Space) @result{} @i{true}
1179
(graphic-char-p #\Newline) @result{} @i{false}
1182
@subsubheading Exceptional Situations::
1184
Should signal an error of @i{type} @b{type-error}
1185
if @i{character} is not a @i{character}.
1187
@subsubheading See Also::
1191
@ref{Character Syntax},
1192
@ref{Documentation of Implementation-Defined Scripts}
1194
@node standard-char-p, char-upcase, graphic-char-p, Characters Dictionary
1195
@subsection standard-char-p [Function]
1197
@code{standard-char-p} @i{character} @result{} @i{generalized-boolean}
1199
@subsubheading Arguments and Values::
1201
@i{character}---a @i{character}.
1203
@i{generalized-boolean}---a @i{generalized boolean}.
1205
@subsubheading Description::
1207
Returns @i{true} if @i{character} is of @i{type} @b{standard-char};
1208
otherwise, returns @i{false}.
1210
@subsubheading Examples::
1213
(standard-char-p #\Space) @result{} @i{true}
1214
(standard-char-p #\~) @result{} @i{true}
1215
;; This next example presupposes an implementation
1216
;; in which #\Bell is a defined character.
1217
(standard-char-p #\Bell) @result{} @i{false}
1220
@subsubheading Exceptional Situations::
1222
Should signal an error of @i{type} @b{type-error}
1223
if @i{character} is not a @i{character}.
1225
@node char-upcase, upper-case-p, standard-char-p, Characters Dictionary
1226
@subsection char-upcase, char-downcase [Function]
1228
@code{char-upcase} @i{character} @result{} @i{corresponding-character}
1230
@code{char-downcase} @i{character} @result{} @i{corresponding-character}
1232
@subsubheading Arguments and Values::
1234
@i{character}, @i{corresponding-character}---a @i{character}.
1236
@subsubheading Description::
1238
If @i{character} is a @i{lowercase} @i{character},
1239
@b{char-upcase} returns the corresponding @i{uppercase} @i{character}.
1240
Otherwise, @b{char-upcase} just returns the given @i{character}.
1242
If @i{character} is an @i{uppercase} @i{character},
1243
@b{char-downcase} returns the corresponding @i{lowercase} @i{character}.
1244
Otherwise, @b{char-downcase} just returns the given @i{character}.
1246
The result only ever differs from @i{character}
1247
in its @i{code} @i{attribute};
1248
all @i{implementation-defined} @i{attributes} are preserved.
1250
@subsubheading Examples::
1253
(char-upcase #\a) @result{} #\A
1254
(char-upcase #\A) @result{} #\A
1255
(char-downcase #\a) @result{} #\a
1256
(char-downcase #\A) @result{} #\a
1257
(char-upcase #\9) @result{} #\9
1258
(char-downcase #\9) @result{} #\9
1259
(char-upcase #\@@) @result{} #\@@
1260
(char-downcase #\@@) @result{} #\@@
1261
;; Note that this next example might run for a very long time in
1262
;; some implementations if CHAR-CODE-LIMIT happens to be very large
1263
;; for that implementation.
1264
(dotimes (code char-code-limit)
1265
(let ((char (code-char code)))
1267
(unless (cond ((upper-case-p char) (char= (char-upcase (char-downcase char)) char))
1268
((lower-case-p char) (char= (char-downcase (char-upcase char)) char))
1269
(t (and (char= (char-upcase (char-downcase char)) char)
1270
(char= (char-downcase (char-upcase char)) char))))
1275
@subsubheading Exceptional Situations::
1277
Should signal an error of @i{type} @b{type-error}
1278
if @i{character} is not a @i{character}.
1280
@subsubheading See Also::
1286
@ref{Characters With Case},
1287
@ref{Documentation of Implementation-Defined Scripts}
1289
@subsubheading Notes::
1291
If the @i{corresponding-char} is @i{different} than @i{character},
1292
then both the @i{character} and the @i{corresponding-char} have @i{case}.
1294
Since @b{char-equal} ignores the @i{case} of the @i{characters} it compares,
1295
the @i{corresponding-character} is always the @i{same} as @i{character}
1296
under @b{char-equal}.
1298
@node upper-case-p, char-code, char-upcase, Characters Dictionary
1299
@subsection upper-case-p, lower-case-p, both-case-p [Function]
1301
@code{upper-case-p} @i{character} @result{} @i{generalized-boolean}
1303
@code{lower-case-p} @i{character} @result{} @i{generalized-boolean}
1305
@code{both-case-p} @i{character} @result{} @i{generalized-boolean}
1307
@subsubheading Arguments and Values::
1309
@i{character}---a @i{character}.
1311
@i{generalized-boolean}---a @i{generalized boolean}.
1313
@subsubheading Description::
1315
These functions test the case of a given @i{character}.
1317
@b{upper-case-p} returns @i{true} if @i{character} is an @i{uppercase} @i{character};
1318
otherwise, returns @i{false}.
1320
@b{lower-case-p} returns @i{true} if @i{character} is a @i{lowercase} @i{character};
1321
otherwise, returns @i{false}.
1323
@b{both-case-p} returns @i{true} if @i{character} is a @i{character} with @i{case};
1324
otherwise, returns @i{false}.
1326
@subsubheading Examples::
1329
(upper-case-p #\A) @result{} @i{true}
1330
(upper-case-p #\a) @result{} @i{false}
1331
(both-case-p #\a) @result{} @i{true}
1332
(both-case-p #\5) @result{} @i{false}
1333
(lower-case-p #\5) @result{} @i{false}
1334
(upper-case-p #\5) @result{} @i{false}
1335
;; This next example presupposes an implementation
1336
;; in which #\Bell is an implementation-defined character.
1337
(lower-case-p #\Bell) @result{} @i{false}
1340
@subsubheading Exceptional Situations::
1342
Should signal an error of @i{type} @b{type-error}
1343
if @i{character} is not a @i{character}.
1345
@subsubheading See Also::
1350
@ref{Characters With Case},
1351
@ref{Documentation of Implementation-Defined Scripts}
1353
@node char-code, char-int, upper-case-p, Characters Dictionary
1354
@subsection char-code [Function]
1356
@code{char-code} @i{character} @result{} @i{code}
1358
@subsubheading Arguments and Values::
1360
@i{character}---a @i{character}.
1362
@i{code}---a @i{character code}.
1364
@subsubheading Description::
1366
@b{char-code} returns the @i{code} @i{attribute} of @i{character}.
1368
@subsubheading Examples::
1371
;; An implementation using ASCII character encoding
1372
;; might return these values:
1373
(char-code #\$) @result{} 36
1374
(char-code #\a) @result{} 97
1377
@subsubheading Exceptional Situations::
1379
Should signal an error of @i{type} @b{type-error}
1380
if @i{character} is not a @i{character}.
1382
@subsubheading See Also::
1384
@ref{char-code-limit}
1386
@node char-int, code-char, char-code, Characters Dictionary
1387
@subsection char-int [Function]
1389
@code{char-int} @i{character} @result{} @i{integer}
1391
@subsubheading Arguments and Values::
1393
@i{character}---a @i{character}.
1395
@i{integer}---a non-negative @i{integer}.
1397
@subsubheading Description::
1399
Returns a non-negative @i{integer} encoding the @i{character} object.
1400
The manner in which the @i{integer} is computed is @i{implementation-dependent}.
1401
In contrast to @b{sxhash}, the result is not guaranteed to be independent
1402
of the particular @i{Lisp image}.
1404
If @i{character} has no @i{implementation-defined} @i{attributes},
1405
the results of @b{char-int} and @b{char-code} are the same.
1408
(char= @i{c1} @i{c2}) @equiv{} (= (char-int @i{c1}) (char-int @i{c2}))
1411
for characters @i{c1} and @i{c2}.
1413
@subsubheading Examples::
1416
(char-int #\A) @result{} 65 ; implementation A
1417
(char-int #\A) @result{} 577 ; implementation B
1418
(char-int #\A) @result{} 262145 ; implementation C
1421
@subsubheading See Also::
1425
@node code-char, char-code-limit, char-int, Characters Dictionary
1426
@subsection code-char [Function]
1428
@code{code-char} @i{code} @result{} @i{char-p}
1430
@subsubheading Arguments and Values::
1432
@i{code}---a @i{character code}.
1434
@i{char-p}---a @i{character} or @b{nil}.
1436
@subsubheading Description::
1438
Returns a @i{character} with the @i{code} @i{attribute} given by @i{code}.
1439
If no such @i{character} exists and one cannot be created, @b{nil} is returned.
1441
@subsubheading Examples::
1444
(code-char 65.) @result{} #\A ;in an implementation using ASCII codes
1445
(code-char (char-code #\Space)) @result{} #\Space ;in any implementation
1448
@subsubheading Affected By::
1450
The @i{implementation}'s character encoding.
1452
@subsubheading See Also::
1456
@subsubheading Notes::
1458
@node char-code-limit, char-name, code-char, Characters Dictionary
1459
@subsection char-code-limit [Constant Variable]
1461
@subsubheading Constant Value::
1463
A non-negative @i{integer}, the exact magnitude of which
1464
is @i{implementation-dependent}, but which is not less
1465
than @t{96} (the number of @i{standard characters}).
1467
@subsubheading Description::
1469
The upper exclusive bound on the @i{value} returned by
1470
the @i{function} @b{char-code}.
1472
@subsubheading See Also::
1476
@subsubheading Notes::
1478
The @i{value} of @b{char-code-limit} might be larger than the actual
1479
number of @i{characters} supported by the @i{implementation}.
1481
@node char-name, name-char, char-code-limit, Characters Dictionary
1482
@subsection char-name [Function]
1484
@code{char-name} @i{character} @result{} @i{name}
1486
@subsubheading Arguments and Values::
1488
@i{character}---a @i{character}.
1490
@i{name}---a @i{string} or @b{nil}.
1492
@subsubheading Description::
1494
Returns a @i{string} that is the @i{name} of the @i{character},
1495
or @b{nil} if the @i{character} has no @i{name}.
1497
All @i{non-graphic} characters are required to have @i{names}
1498
unless they have some @i{implementation-defined} @i{attribute}
1499
which is not @i{null}. Whether or not other @i{characters}
1500
have @i{names} is @i{implementation-dependent}.
1502
The @i{standard characters}
1503
<@i{Newline}> and <@i{Space}> have the respective names @t{"Newline"} and @t{"Space"}.
1504
The @i{semi-standard} @i{characters}
1505
<@i{Tab}>, <@i{Page}>, <@i{Rubout}>, <@i{Linefeed}>, <@i{Return}>, and <@i{Backspace}>
1506
(if they are supported by the @i{implementation})
1507
have the respective names
1508
@t{"Tab"}, @t{"Page"}, @t{"Rubout"}, @t{"Linefeed"}, @t{"Return"}, and @t{"Backspace"}
1509
(in the indicated case, even though name lookup by ``@t{#\}''
1510
and by the @i{function} @b{name-char} is not case sensitive).
1512
@subsubheading Examples::
1515
(char-name #\ ) @result{} "Space"
1516
(char-name #\Space) @result{} "Space"
1517
(char-name #\Page) @result{} "Page"
1521
@i{OR}@result{} "LOWERCASE-a"
1522
@i{OR}@result{} "Small-A"
1523
@i{OR}@result{} "LA01"
1527
@i{OR}@result{} "UPPERCASE-A"
1528
@i{OR}@result{} "Capital-A"
1529
@i{OR}@result{} "LA02"
1531
;; Even though its CHAR-NAME can vary, #\A prints as #\A
1532
(prin1-to-string (read-from-string (format nil "#\\~A" (or (char-name #\A) "A"))))
1536
@subsubheading Exceptional Situations::
1538
Should signal an error of @i{type} @b{type-error}
1539
if @i{character} is not a @i{character}.
1541
@subsubheading See Also::
1545
@ref{Printing Characters}
1547
@subsubheading Notes::
1550
@i{characters} having @i{names} are written by the @i{Lisp printer}
1551
as ``@t{#\}'' followed by the their @i{name}; see @ref{Printing Characters}.
1553
@node name-char, , char-name, Characters Dictionary
1554
@subsection name-char [Function]
1556
@code{name-char} @i{name} @result{} @i{char-p}
1558
@subsubheading Arguments and Values::
1560
@i{name}---a @i{string designator}.
1562
@i{char-p}---a @i{character} or @b{nil}.
1564
@subsubheading Description::
1566
Returns the @i{character} @i{object} whose @i{name} is
1567
@i{name} (as determined by @b{string-equal}---@i{i.e.}, lookup is not case sensitive).
1568
If such a @i{character} does not exist, @b{nil} is returned.
1570
@subsubheading Examples::
1573
(name-char 'space) @result{} #\Space
1574
(name-char "space") @result{} #\Space
1575
(name-char "Space") @result{} #\Space
1576
(let ((x (char-name #\a)))
1577
(or (not x) (eql (name-char x) #\a))) @result{} @i{true}
1580
@subsubheading Exceptional Situations::
1582
Should signal an error of @i{type} @b{type-error}
1583
if @i{name} is not a @i{string designator}.
1585
@subsubheading See Also::
1589
@c end of including dict-characters
1591
@c %**end of chapter