<div dir="ltr"><font face="courier new, monospace">I have a signature that includes a macro to clean up the use of one of the procs in the signature.</font><div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">Two different units with the same signature are used via define-values/invoke-unit - the second one uses a prefix in the export sig-spec to differentiate it from the first.</font></div>
<div><font face="courier new, monospace">The macro introduced by the second use does not refer to the other proc using the prefix.</font></div><div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">The concrete example:</font></div>
<div><font face="courier new, monospace"><br></font></div><div><div><font face="courier new, monospace">;; Signature of a message channel</font></div><div><font face="courier new, monospace">(define-signature message-channel^</font></div>
<div><font face="courier new, monospace"> (</font></div><div><font face="courier new, monospace"> ;; ...</font></div><div><font face="courier new, monospace"> msg-chan-subscribe ; ( (msg -> boolean) first? -> thunk)</font></div>
<div><font face="courier new, monospace"> </font></div><div><font face="courier new, monospace"> ;; Enqueue message(s) for a channel at normal priority </font></div><div><font face="courier new, monospace"> <-- ; ( msg .. -> void )</font></div>
<div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace"> ;; Enqueue message(s) for a channel at high priority </font></div><div><font face="courier new, monospace"> <++ ; ( msg .. -> void )</font></div>
<div><font face="courier new, monospace"> </font></div><div><font face="courier new, monospace"> ;; Macro to create a message handler.</font></div><div><font face="courier new, monospace"> ;; ...</font></div><div>
<font face="courier new, monospace"> (define-syntaxes (==>)</font></div><div><font face="courier new, monospace"> (syntax-rules (msg)</font></div><div><font face="courier new, monospace"> [(_ match-body ...) (msg-chan-subscribe </font></div>
<div><font face="courier new, monospace"> (ë(msg) </font></div><div><font face="courier new, monospace"> (syntax-parameterize </font></div><div><font face="courier new, monospace"> ([the-message (make-rename-transformer #'msg)])</font></div>
<div><font face="courier new, monospace"> (match msg </font></div><div><font face="courier new, monospace"> match-body ...</font></div><div><font face="courier new, monospace"> [_ #t])))</font></div>
<div><font face="courier new, monospace"> #f)]))</font><span style="font-family:'courier new',monospace">))</span></div></div><div><span style="font-family:'courier new',monospace"><br>
</span></div><div><span style="font-family:'courier new',monospace"><br></span></div><div><span style="font-family:'courier new',monospace">When (</span><span style="font-family:'courier new',monospace">define-values/invoke-unit <some-unit> (import) (export (prefix diagram message-channel^))) is used it introduces the bindings diagram<-- , diagram<++ , diagrammsg-chan-subscribe and diagram==> .</span></div>
<div><span style="font-family:'courier new',monospace"><br></span></div><div><span style="font-family:'courier new',monospace">The form</span></div><div><font face="courier new, monospace"><br></font></div>
<div><font face="courier new, monospace">(diagram==></font></div><div><font face="courier new, monospace"> .. message handlers ..)</font></div><div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">expands to (msg-chan-subscribe ...) rather than (</font><span style="font-family:'courier new',monospace">diagrammsg-chan-subscribe ...) - and thus it listens to the first (wrong) message channel.</span></div>
<div><span style="font-family:'courier new',monospace"><br></span></div><div><span style="font-family:'courier new',monospace">Is there any way to make macros defined in signatures be aware of the prefix used with the signature ?</span></div>
</div>