[racket] Provide transformers
I've been looking into how to design a macro that would specify tests in a
provide transformer, for example something like
(provide (test-pred-out some-integer integer?))
I'd like that to expand to:
(provide some-integer)
(module+ test
(check-pred integer? some-integer))
>From what I can gather from the reference, normally provide forms are done
with define-provide-syntax, but that macro doesn't let me splice anything
into the module body. The reference mentions provide pre-transformers, and
says:
"A provide pre-transformer is applied as part of the first phase of a
module’s expansion. Since it is used in the first phase, a provide
pre-transformer can use functions such as syntax-local-lift-expression to
introduce expressions and definitions in the enclosing module."
So it sounds like what I want is definitely possible, but I have no idea
how to actually *do* it. Does anyone have some simple well-explained
examples to guide me in the right direction?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20140919/036e2577/attachment.html>