chickadee » check-errors » define-check+error-type

(define-check+error-type TYPNAM [TYPE-PRED [TYPMSG]])syntax

Creates a procedure definition for check-TYPNAM with the signature of the above check procedures. The type-predicate is either TYPE-PRED, when present, or TYPE?. The error message type-name is either the TYPMSG, when present, or "TYPNAM".

TYPNAM is an unquoted symbol.

(define-check+error-type hash-table)
;=>
;(begin
;  (define-error-type hash-table)
;  (define (check-hash-table loc obj #!optional argnam)
;    (unless (hash-table? obj)
;      (error-hash-table loc obj argnam))
;    obj))