Skip to main content

simple-warning

simple-warning Condition Type

Class Precedence List:

simple-warning, simple-condition, warning, condition, t

Description:

The type simple-warning represents conditions that are signaled by warn whenever a format control is supplied as the function’s first argument.

Expanded Reference: simple-warning

The simple-warning Type

simple-warning is the default condition type signaled by warn when a format string is passed. It inherits from both simple-condition and warning.

(subtypep 'simple-warning 'warning)

=> T
=> T
(subtypep 'simple-warning 'simple-condition)

=> T
=> T

Created Implicitly by warn

(handler-bind ((simple-warning (lambda (c)
(declare (ignore c))
(muffle-warning))))
(warn "Low disk space")
:warned)

=> :WARNED

Accessing Format Information

(handler-case
(warn "~D files remaining" 3)
(simple-warning (c)
(simple-condition-format-arguments c)))

=> (3)