4.1. Types
Prev | Chapter 4. Types and Classes | Next

## 4.1. Types [sec_4-2]

### 4.1.1. Type Specifiers [sec_4-2-3]

The general form of the `COMPLEX` type specifier is `(`COMPLEX` `type-of-real-part` `type-of-imaginary-part`)`. The type specifier `(`COMPLEX` `type`)` is equivalent to `(`COMPLEX` `type` `type`)`.

`DEFTYPE` lambda lists are subject to destructuring (nested lambda lists are allowed, as in `DEFMACRO`) and may contain a `&WHOLE` marker, but not an `&ENVIRONMENT` marker.

Function `(`EXT:TYPE-EXPAND` `type` `&OPTIONAL` `once-p`)`. If `type` is a user-defined type specifier this will expand it recursively until it is no longer a user-defined type (unless `once-p` is supplied and non-`NIL`). Two values are returned - the expansion and an indicator (`T` or `NIL`) of whether the original `type` was a user-defined type specifier.

The possible results of `TYPE-OF`

- `CONS`
- `SYMBOL`, `NULL`, `BOOLEAN`, `KEYWORD`
- `BIT`, `(`INTEGER` 0 `#.``MOST-POSITIVE-FIXNUM`)`, `(`INTEGER` `#.``MOST-NEGATIVE-FIXNUM` (0))`, `(`INTEGER` (`#.``MOST-POSITIVE-FIXNUM`))`, `(`INTEGER` * (`#.``MOST-NEGATIVE-FIXNUM`))`
- `RATIONAL`, `SHORT-FLOAT`, `SINGLE-FLOAT`, `DOUBLE-FLOAT`, `LONG-FLOAT`, `COMPLEX`
- `CHARACTER`, `BASE-CHAR`, `STANDARD-CHAR`
- `(`ARRAY` `element-type` `dimensions`)`, `(`SIMPLE-ARRAY` `element-type` `dimensions`)`
- `(`VECTOR` `T` `size`)`, `(`SIMPLE-VECTOR` `size`)`
- `(`STRING` `size`)`, `(`SIMPLE-STRING` `size`)`
- `(`BASE-STRING` `size`)`, `(`SIMPLE-BASE-STRING` `size`)`
- `(`BIT-VECTOR` `size`)`, `(`SIMPLE-BIT-VECTOR` `size`)`
- `FUNCTION`, `COMPILED-FUNCTION`, `STANDARD-GENERIC-FUNCTION`
- `STREAM`, `FILE-STREAM`, `SYNONYM-STREAM`, `BROADCAST-STREAM`, `CONCATENATED-STREAM`, `TWO-WAY-STREAM`, `ECHO-STREAM`, `STRING-STREAM`
- `PACKAGE`, `HASH-TABLE`, `READTABLE`, `PATHNAME`, `LOGICAL-PATHNAME`, `RANDOM-STATE`, BYTE
- `SPECIAL-OPERATOR`, `LOAD-TIME-EVAL`, `SYMBOL-MACRO`, `GLOBAL-SYMBOL-MACRO`, `EXT:ENCODING`, `FFI:FOREIGN-POINTER`, `FFI:FOREIGN-ADDRESS`, `FFI:FOREIGN-VARIABLE`, `FFI:FOREIGN-FUNCTION`
- `EXT:WEAK-POINTER`, `EXT:WEAK-LIST`, `EXT:WEAK-AND-RELATION`, `EXT:WEAK-OR-RELATION`, `EXT:WEAK-MAPPING`, `EXT:WEAK-AND-MAPPING`, `EXT:WEAK-OR-MAPPING`, `EXT:WEAK-ALIST`, `READ-LABEL`, `FRAME-POINTER`, `SYSTEM-INTERNAL`
- `ADDRESS` (should not occur)
- any other `SYMBOL` (structure types or CLOS classes)
- a class object (CLOS classes without a proper name)

Function `COERCE`. `FIXNUM` is not a character designator in [ANSI CL standard], although `CODE-CHAR` provides an obvious venue to `COERCE` a `FIXNUM` to a `CHARACTER`. When `CUSTOM:*COERCE-FIXNUM-CHAR-ANSI*` is `NIL`, CLISP `COERCE`s `FIXNUM`s to `CHARACTER`s via `CODE-CHAR`. When `CUSTOM:*COERCE-FIXNUM-CHAR-ANSI*` is non-`NIL`, `FIXNUM`s cannot be `COERCE`d to `CHARACTER`s.

| These notes document CLISP version 2.45 | Last modified: 2008-05-14

Enter your search termsSubmit search form
Webclisp.cons.orgclisp.podval.orgwww.lisp.org

Prev | Up | Next
Chapter 4. Types and Classes | Home | 4.2. Classes