

4.2.3 Type Specifiers

Type specifiers can be symbols, classes, or lists. Figure 4-2 lists symbols that are standardized atomic type specifiers, and Figure 4-3 lists standardized compound type specifier names. For syntax information, see the dictionary entry for the corresponding type specifier. It is possible to define new type specifiers using defclass, define-condition, defstruct, or deftype.

arithmetic-error                  function            simple-condition           
array                             generic-function    simple-error               
atom                              hash-table          simple-string              
base-char                         integer             simple-type-error          
base-string                       keyword             simple-vector              
bignum                            list                simple-warning             
bit                               logical-pathname    single-float               
bit-vector                        long-float          standard-char              
broadcast-stream                  method              standard-class             
cell-error                        nil                 standard-method            
character                         null                standard-object            
class                             number              storage-condition          
compiled-function                 package             stream                     
complex                           package-error       stream-error               
concatenated-stream               parse-error         string                     
condition                         pathname            string-stream              
cons                              print-not-readable  structure-class            
control-error                     program-error       structure-object           
division-by-zero                  random-state        style-warning              
double-float                      ratio               symbol                     
echo-stream                       rational            synonym-stream             
end-of-file                       reader-error        t                          
error                             readtable           two-way-stream             
extended-char                     real                type-error                 
file-error                        restart             unbound-slot               
file-stream                       sequence            unbound-variable           
fixnum                            serious-condition   undefined-function         
float                             short-float         unsigned-byte              
floating-point-inexact            signed-byte         vector                     
floating-point-invalid-operation  simple-array        warning                    
floating-point-overflow           simple-base-string                             
floating-point-underflow          simple-bit-vector                              

Figure 4-2. Standardized Atomic Type Specifiers


 (vector double-float 100)
The following leaves the length unspecified:

 (vector double-float *)
The following leaves the element type unspecified:

 (vector * 100)                                      


and           long-float    simple-base-string  
array         member        simple-bit-vector   
base-string   mod           simple-string       
bit-vector    not           simple-vector       
complex       or            single-float        
cons          rational      string              
double-float  real          unsigned-byte       
eql           satisfies     values              
float         short-float   vector              
function      signed-byte                       
integer       simple-array                      

Figure 4-3. Standardized Compound Type Specifier Names


and     mod  satisfies  
eql     not  values     
member  or              

Figure 4-4. Standardized Compound-Only Type Specifier Names

New type specifiers can come into existence in two ways.

* Defining a structure by using defstruct without using the :type specifier or defining a class by using defclass or define-condition automatically causes the name of the structure or class to be a new type specifier symbol.
* deftype can be used to define derived type specifiers, which act as `abbreviations' for other type specifiers.



coerce            defstruct  subtypep  
declaim           deftype    the       
declare           ftype      type      
defclass          locally    type-of   
define-condition  proclaim   typep     

Figure 4-5. Defined names relating to types and declarations.

The next figure shows all defined names that are type specifier names, whether for atomic type specifiers or compound type specifiers; this list is the union of the lists in Figure 4-2 and Figure 4-3.

and                               function            simple-array               
arithmetic-error                  generic-function    simple-base-string         
array                             hash-table          simple-bit-vector          
atom                              integer             simple-condition           
base-char                         keyword             simple-error               
base-string                       list                simple-string              
bignum                            logical-pathname    simple-type-error          
bit                               long-float          simple-vector              
bit-vector                        member              simple-warning             
broadcast-stream                  method              single-float               
built-in-class                    method-combination  standard-char              
cell-error                        mod                 standard-class             
character                         nil                 standard-generic-function  
class                             not                 standard-method            
compiled-function                 null                standard-object            
complex                           number              storage-condition          
concatenated-stream               or                  stream                     
condition                         package             stream-error               
cons                              package-error       string                     
control-error                     parse-error         string-stream              
division-by-zero                  pathname            structure-class            
double-float                      print-not-readable  structure-object           
echo-stream                       program-error       style-warning              
end-of-file                       random-state        symbol                     
eql                               ratio               synonym-stream             
error                             rational            t                          
extended-char                     reader-error        two-way-stream             
file-error                        readtable           type-error                 
file-stream                       real                unbound-slot               
fixnum                            restart             unbound-variable           
float                             satisfies           undefined-function         
floating-point-inexact            sequence            unsigned-byte              
floating-point-invalid-operation  serious-condition   values                     
floating-point-overflow           short-float         vector                     
floating-point-underflow          signed-byte         warning                    

Figure 4-6. Standardized Type Specifier Names


Copyright 1996-2005, LispWorks Ltd. All rights reserved.