(rontolisp) docs
← Macros

typep

(typep object 'type-specifier)

Tests whether object is of the given type. Lite: the type specifier is normally a literal (quoted) type — the same set typecase supports (atomic names, registered classes, zero-parameter user deftype names, and the compound specifiers (or ...)/(and ...)/(not ...)/(member ...)/(eql ...)/(satisfies ...)/ranged numerics/(unsigned-byte n)/(signed-byte n)); an unknown specifier matches nothing.

A specifier computed at run time is supported when it is an ATOMIC type name (a registered class / struct / condition, or a built-in name) or a class metaobject — what find-class and class-of answer designates its own class. The compound specifiers above still require a literal. class is the class every class metaobject belongs to, so (typep x 'class) is the "is this a class?" test.