(module exn mzscheme
(require-for-syntax
(file "syntax.ss")
)
(provide
(all-defined)
)
(define-syntax (raise-exn stx)
(syntax-case stx ()
[(_ exception message)
(with-syntax
([make-proc (make-syntax-symbol stx 'make- (syntax exception))])
(syntax
(raise
(make-proc
(string->immutable-string message)
(current-continuation-marks)))))]))
(define-syntax (raise-exn/append stx)
(syntax-case stx ()
[(_ exception message messages ...)
(with-syntax
([make-proc (make-syntax-symbol stx 'make- (syntax exception))])
(syntax
(raise
(make-proc
(string->immutable-string (string-append message messages ...))
(current-continuation-marks)))))]))
(define-syntax (raise-exn/format stx)
(syntax-case stx ()
[(_ exception template params ...)
(with-syntax
([make-proc (make-syntax-symbol stx 'make- (syntax exception))])
(syntax
(raise
(make-proc
(string->immutable-string (format template params ...))
(current-continuation-marks)))))]))
)