Next: , Previous: , Up: Alien Types   [Contents][Index]


8.2.2 Alien Types and Lisp Types

The Alien types form a subsystem of the CMUCL type system. An alien type specifier provides a way to use any Alien type as a Lisp type specifier. For example

(typep foo '(alien (* int)))

can be used to determine whether foo is a pointer to an int. alien type specifiers can be used in the same ways as ordinary type specifiers (like string.) Alien type declarations are subject to the same precise type checking as any other declaration (see precise-type-checks.)

Note that the Alien type system overlaps with normal Lisp type specifiers in some cases. For example, the type specifier (alien single-float) is identical to single-float, since Alien floats are automatically converted to Lisp floats. When type-of is called on an Alien value that is not automatically converted to a Lisp value, then it will return an alien type specifier.