Next: , Previous: , Up: args   [Index]


8.2 Defining argument validation clauses

The following bindings are exported by the library (vicare arguments validation).

Macro: define-argument-validation (?name ?who ?arg ...) ?predicate ?error-handler

Define a validation clause to be used along with the syntax WITH-ARGUMENTS-VALIDATION. Example:

(define-argument-validation (bytevector who bv)
  (bytevector? bv)
  (procedure-argument-violation who
    "expected a bytevector as argument"
    bv))

We have to assume that the values ?arg are evaluated multiple times.