2 ms·
Types in Common Lisp may or may not be represented by classes (all classes are types, not all types are classes). In this case, character is indeed a class, whi
by db48x 10y ago
Types in Common Lisp may or may not be represented by classes (all classes are types, not all types are classes). In this case, character is indeed a class, while base-char is not.
It's definitely true to say that base-char is a subtype of character, in that some characters are also base-chars, while others are not. (The spec defines that there are at least 96 standard characters, all of which are of type standard-char, and thus also of type base-char. Implementations may add others. Interestingly, the spec doesn't define how those characters are encoded; of course most modern implementations use some variant of Unicode.)
Some examples:
(typep #\A 'base-char) ⇒ true
(typep #\A 'standard-char) ⇒ true
(typep #\A 'extended-char) ⇒ false
(typep #\A 'character) ⇒ true
(typep #\𝀽 'base-char) ⇒ false
(typep #\𝀽 'extended-char) ⇒ true
etc.