Chapter 11
The Built-In Classes
Simple Objects
Simple objects are sealed, uninstantiable, and concrete. They are often represented by program literals. Figure 11-2 shows the built-in classes of simple objects.
Figure 11-2 The Simple Object Classes
| S | – Sealed | P | – Primary | C | – Concrete | I | – Instantiable |
| O | – Open | F | – Free | A | – Abstract | U | – Uninstantiable |
Characters
<character> [Sealed Class]
The class of characters.
- Superclasses:
<object>- Init-keywords:
None.
- Description:
The class of characters. All characters are instances of
<character>.- Operations:
-
The class
<character>provides the following operations:Table 11-8 Methods on <character> Function
Description
Page
<Returns true if its first operand is less than its second operand.
as-uppercaseas-lowercaseas
Symbols
<symbol> [Sealed Class]
The class of symbols.
- Superclasses:
<object>- Init-keywords:
None.
- Description:
The
<symbol>class provides a built-in, non-case-sensitive dictionary that associates a string with a unique immutable object that can be compared with==(which should be faster than calling a string-comparison routine). This dictionary is accessed through theasfunction:as(<symbol>, string)andas(<string>, symbol). Any string can be used.- Operations:
-
The class
<symbol>provides the following operation:Table 11-9 Methods on <symbol> Function
Description
Page
as
Booleans
<boolean> [Sealed Class]
The class of boolean values.
- Superclasses:
<object>- Init-keywords:
None.
- Operations:
None.
- Description:
The class of boolean values. The literal constants
#tand#fare general instances of<boolean>. Note that for the purposes of conditional expressions, all objects besides#fcount as true. (This does not imply any other objects are instances of<boolean>.)