3.5. The Evaluation and Compilation Dictionary
Prev | Chapter 3. Evaluation and Compilation | Next

## 3.5. The Evaluation and Compilation Dictionary [sec_the_evalu_n_dictionary]

### 3.5.1. Function `CONSTANTP`

Function `CONSTANTP` fully complies with [ANSI CL standard]. Additionally, some non-trivial forms are identified as constants, e.g., `(`CONSTANTP` '(`+` 1 2 3))` returns `T`.

### Warning

Since `DEFCONSTANT` initial value forms are not evaluated at compile time, `CONSTANTP` will not report `T` of their name within the same compilation unit for the null lexical environment. This is consistent and matches questionable code using the pattern `(`IF` (`CONSTANTP` `form`) (`EVAL` `form`))`. Use `EVAL-WHEN` if you need recognition and the value during compile-time.

### 3.5.2. Macro `EVAL-WHEN`

`EVAL-WHEN` also accepts the situations `(NOT EVAL)` and `(NOT COMPILE)`.

### Warning

The situations `EVAL`, `LOAD` and `COMPILE` are deprecated by the [ANSI CL standard], and they are not equivalent to the new standard situations `:EXECUTE`, `:LOAD-TOPLEVEL` and `:COMPILE-TOPLEVEL` in that they ignore the top-level form versus non-top-level form distinction.

### 3.5.3. Special operator `THE`

The special form `(`THE` `value-type` `form`)` is similar to `CHECK-TYPE` but does a type check only in interpreted code (no type check is done in compiled code - but see the `EXT:ETHE` macro) and does not allow interactive error correction by the user.

| These notes document CLISP version 2.45 | Last modified: 2008-04-15

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

Prev | Up | Next
3.4. Lambda Lists | Home | Chapter 4. Types and Classes