Next: , Previous: , Up: conditions   [Contents][Index]


3.2 Predefined condition types compatible with R6RS

Hierarchy of predefined condition types:

&condition
   |
   +-----> &warning
   |
   +-----> &message
   |       &irritants
   |       &who
   |
   +-----> &serious
              |
              +-----> &error
              |
              +-----> &violation
                         |
                         +-----> &assertion
                         |
                         +-----> &non-continuable
                         |
                         +-----> &implementation-restriction
                         |
                         +-----> &lexical
                         |
                         +-----> &syntax
                         |
                          -----> &undefined
Condition Kind: &message
Function: make-message-condition message
Function: message-condition? obj
Function: condition-message condition

This condition type could be defined by:

(define-condition-type &message &condition
  make-message-condition message-condition?
  (message condition-message))

It carries a message further describing the nature of the condition to humans.

Condition Kind: &warning
Function: make-warning
Function: warning? obj

This condition type could be defined by:

(define-condition-type &warning &condition
  make-warning warning?)

This type describes conditions that do not, in principle, prohibit immediate continued execution of the program, but may interfere with the program’s execution later.

Condition Kind: &serious
Function: make-serious-condition
Function: serious-condition? obj

This condition type could be defined by:

(define-condition-type &serious &condition
  make-serious-condition serious-condition?)

This type describes conditions serious enough that they cannot safely be ignored. This condition type is primarily intended as a supertype of other condition types.

Condition Kind: &error
Function: make-error
Function: error? obj

This condition type could be defined by:

(define-condition-type &error &serious
  make-error error?)

This type describes errors, typically caused by something that has gone wrong in the interaction of the program with the external world or the user.

Condition Kind: &violation
Function: make-violation
Function: violation? obj

This condition type could be defined by:

(define-condition-type &violation &serious
  make-violation violation?)

This type describes violations of the language standard or a library standard, typically caused by a programming error.

Condition Kind: &assertion
Function: make-assertion-violation
Function: assertion-violation? obj

This condition type could be defined by:

(define-condition-type &assertion &violation
  make-assertion-violation assertion-violation?)

This type describes an invalid call to a procedure, either passing an invalid number of arguments, or passing an argument of the wrong type.

Condition Kind: &irritants
Function: make-irritants-condition irritants
Function: irritants-condition? obj
Function: condition-irritants condition

This condition type could be defined by:

(define-condition-type &irritants &condition
  make-irritants-condition irritants-condition?
  (irritants condition-irritants))

irritants should be a list of objects. This condition provides additional information about a condition, typically the argument list of a procedure that detected an exception. Conditions of this type are created by the procedures error and assertion-violation.

Condition Kind: &who
Function: make-who-condition who
Function: who-condition? obj
Function: condition-who condition

This condition type could be defined by:

(define-condition-type &who &condition
  make-who-condition who-condition?
  (who condition-who))

who should be a symbol or string identifying the entity reporting the exception. Conditions of this type are created by the error and assertion-violation procedures, and the syntax-violation procedure.

Condition Kind: &non-continuable
Function: make-non-continuable-violation
Function: non-continuable-violation? obj

This condition type could be defined by:

(define-condition-type &non-continuable &violation
  make-non-continuable-violation
  non-continuable-violation?)

This type indicates that an exception handler invoked via raise has returned.

Condition Kind: &implementation-restriction
Function: make-implementation-restriction-violation
Function: implementation-restriction-violation? obj

This condition type could be defined by:

(define-condition-type &implementation-restriction
    &violation
  make-implementation-restriction-violation
  implementation-restriction-violation?)

This type describes a violation of an implementation restriction allowed by the specification, such as the absence of representations for NaNs and infinities.

Condition Kind: &lexical
Function: make-lexical-violation
Function: lexical-violation? obj

This condition type could be defined by:

(define-condition-type &lexical &violation
  make-lexical-violation lexical-violation?)

This type describes syntax violations at the level of the datum syntax.

Condition Kind: &syntax
Function: make-syntax-violation form subform
Function: syntax-violation? obj
Function: syntax-violation-form condition
Function: syntax-violation-subform condition

This condition type could be defined by:

(define-condition-type &syntax &violation
  make-syntax-violation syntax-violation?
  (form syntax-violation-form)
  (subform syntax-violation-subform))

This type describes syntax violations. form should be the erroneous syntax object or a datum representing the code of the erroneous form. subform should be an optional syntax object or datum within the erroneous form that more precisely locates the violation. It can be #f to indicate the absence of more precise information.

Condition Kind: &undefined
Function: make-undefined-violation
Function: undefined-violation? obj

This condition type could be defined by:

(define-condition-type &undefined &violation
  make-undefined-violation undefined-violation?)

This type describes unbound identifiers in the program.


Next: , Previous: , Up: conditions   [Contents][Index]

This document describes version 0.1.0-devel.1 of MMCK Exceptional Conditions.