Next: Precise Type Checking, Up: Handling of Types
The SBCL compiler treats type declarations differently from most other Lisp compilers. Under default compilation policy the compiler doesn't blindly believe type declarations, but considers them assertions about the program that should be checked: all type declarations that have not been proven to always hold are asserted at runtime.
Remaining bugs in the compiler's handling of types unfortunately provide some exceptions to this rule, see Implementation Limitations).
There are three type checking policies available in SBCL,
selectable via optimize
declarations.
Used when (>= safety (max speed space compilation-speed)
. The
default compilation policy provides full type checks.
Used when (< 0 safety (max speed space compilation-speed)
.
Used when (= safety 0)
.