
Next: Control Flow
Up: Programming Constructs
Previous: Primitive Exceptions
The procedure error raises the exception exn:user
(which contains an error string). The error procedure can be
invoked three ways:
- (error message) where message is a symbol.
This creates a message string of the form ``error: message''.
- (error message value
)
where message is a string. Theis creates a message string
by concatenating message with string versions of the values
(as printed by write). A space is inserted before each value. - (error proc message value
)
where proc is a symbol and message is a string.
This creates a message string by evaluating
(format (string-append "
s: " message) proc value
)
(The built-in format and string-append are always used.)
The constructed message string is passed to make-exn:user and
the resulting exception is raised.
PLT