Next: , Previous: , Up: stdlib syntax-case   [Index]


5.12.10 Syntax violations

Procedure: syntax-violation who message form
Procedure: syntax-violation who message form subform

who must be #f or a string or a symbol. message must be a string. form must be a syntax object or a datum value. subform must be a syntax object or a datum value.

The syntax-violation procedure raises an exception, reporting a syntax violation. who should describe the macro transformer that detected the exception. The message argument should describe the violation. form should be the erroneous source syntax object or a datum value representing a form. The optional subform argument should be a syntax object or datum value representing a form that more precisely locates the violation.

If who is #f, syntax-violation attempts to infer an appropriate value for the condition object (see below) as follows: When form is either an identifier or a list-structured syntax object containing an identifier as its first element, then the inferred value is the identifier’s symbol. Otherwise, no value for who is provided as part of the condition object.

The condition object provided with the exception has the following condition types:


Next: , Previous: , Up: stdlib syntax-case   [Index]