Skip to main content

boolean

boolean Type

Supertypes:

boolean, symbol, t

Description:

The type boolean contains the symbols t and nil, which represent true and false, respectively.

See Also:

t (constant variable), nil (constant variable), if, not, complement

Notes:

Conditional operations, such as if, permit the use of generalized booleans, not just booleans; any non-nil value, not just t, counts as true for a generalized boolean. However, as a matter of convention, the symbol t is considered the canonical value to use even for a generalized boolean when no better choice presents itself.

function

Expanded Reference: boolean

The boolean Type

The type boolean contains exactly two elements: t and nil. It is equivalent to (member t nil).

(typep t 'boolean)
=> T

(typep nil 'boolean)
=> T

(typep 42 'boolean)
=> NIL

(typep :true 'boolean)
=> NIL

Subtype Relationships

(subtypep 'boolean 'symbol)
=> T
=> T

(subtypep 'null 'boolean)
=> T
=> T