<br><br><div class="gmail_quote">On Tue, Dec 15, 2009 at 5:37 PM, Chongkai Zhu <span dir="ltr"><<a href="mailto:czhu@cs.utah.edu">czhu@cs.utah.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Use syntax-property and 'certify-mode.<br></blockquote><div><br>I don't know how to do this. Doesn't this require changing the macro that introduces the identifier? How can I do this in the #%module-begin macro where I use local-expand?<br>
</div><div> </div><div> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Chongkai<br>
<br>
Marco Monteiro wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="h5">
I'm trying to store a representation of the expanded code in some module.<br>
I'm currently using one method that translates the syntax to an AST when<br>
expanding the #%module-begin in my language. I am experimenting with<br>
storing the syntax instead, like so:<br>
<br>
(define-syntax (_#%module-begin stx)<br>
(syntax-case stx ()<br>
[(_ . forms)<br>
(let ([a (local-expand (syntax/loc stx (#%plain-module-begin . forms))<br>
'module-begin '())])<br>
(with-syntax ([code a]<br>
[(_ body ...) a])<br>
(syntax/loc stx (#%module-begin<br>
(mute body) ...<br>
(add-code #'code)))))]))<br>
<br>
. In this code, the add-code procedure stores the syntax object.<br>
<br>
This almost works. The problem is that the expanded code can contain<br>
identifiers from other modules that are not exported, so I get errors like<br>
"compile: access from an uncertified context to unexported variable<br>
from module".<br>
<br>
In some cases, I don't have access to the macros. For example, I'm using<br>
quasiquote from scheme that expands to use qq-expand that is not exported.<br>
<br>
Is it possible to make this, or something similar, work?<br>
<br>
Marco<br></div></div>
------------------------------------------------------------------------<div class="im"><br>
<br>
_________________________________________________<br>
For list-related administrative tasks:<br>
<a href="http://list.cs.brown.edu/mailman/listinfo/plt-scheme" target="_blank">http://list.cs.brown.edu/mailman/listinfo/plt-scheme</a><br>
<br>
</div></blockquote>
<br>
</blockquote></div><br>