I found that I define syntax parameters with identical definitions, except for their name, so I decided to write a macro to make it easier:
(define-syntax (test-case-parameter stx)
(syntax-parse stx
[(_ parameter:id)
#'(define-syntax-parameter parameter
(lambda (stx)
(raise-syntax-error stx "Can only be used inside test-case.")))]))
(test-case-parameter a)
(test-case-parameter b)
(test-case-parameter c)
However, instead of repeating the macro name, I would just write:
(test-case-parameter a b c)
But I don’t see how to do this using the syntax of normal ellipses, because I would need to wrap everything in begin, which would create a new scope, and I want all the syntax parameters to be like this, each of them wrote from the top level. What is the right way to accomplish this?
source
share