Next: , Up: expander utils   [Index]


15.4.1 Introduction to utility functions

Some functions accept an optional argument synner: when used, it must be a function accepting 1 or 2 arguments, the first argument being a string error message and the optional second argument being a subform; synner must raise a compound condition object with components: &who, &message, &syntax. The synner argument is meant to be used as follows:

(define-syntax (my-macro stx)
  (case-define synner
    ((message)
     (synner message #f))
    ((message subform)
     (syntax-violation 'my-macro message stx subform)))
  (syntax-case stx ()
    (pattern body)
    (_
     (synner "invalid syntax"))))