<div dir="ltr">I've been looking into how to design a macro that would specify tests in a provide transformer, for example something like<div><br></div><div>    (provide (test-pred-out some-integer integer?))</div><div><br></div><div>I'd like that to expand to:</div><div><br></div><div>    (provide some-integer)<br>    (module+ test</div><div>      (check-pred integer? some-integer))</div><div><br></div><div>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:</div><div><br></div><div>"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."</div><div><br></div><div>So it sounds like what I want is definitely possible, but I have no idea how to actually <i>do</i> it. Does anyone have some simple well-explained examples to guide me in the right direction?</div></div>