Thanks Matt - this is very good tip! ;) <br><br>Appreciated,<br>yinso <br><br><div><span class="gmail_quote">On 4/29/07, <b class="gmail_sendername">Matthew Flatt</b> <<a href="mailto:mflatt@cs.utah.edu">mflatt@cs.utah.edu
</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">After finally stepping back to try to see what you're after, I think
<br>maybe you want to work in something like the following mode:<br><br> > (compile-enforce-module-constants #f)<br> > (module foo mzscheme<br> (define bar (lambda (x) x))<br> (provide bar))<br> > (require foo)
<br> > (bar 10)<br> 10<br> ;; decide to explore `bar' some more...<br> > (current-namespace (module->namespace 'foo))<br> > (require (lib "trace.ss"))<br> > (trace bar)<br> (bar)<br> > (bar 10)
<br> |(bar 10)<br> |10<br> 10<br> ><br><br>That is, to perform debugging tasks like `trace'ing a module binding,<br>switch to a namespace that reflects the module's content where `trace'<br>can work (as long as module constants are not enforced up front).
<br><br>If that's not exactly right, I still imagine that you're trying to<br>create a debugging tool, and so reflective operations like<br>`module->namespace' and even `eval' are maybe the right starting
<br>points, instead of `#%top'.<br><br>Matthew<br><br>At Mon, 23 Apr 2007 21:05:46 -0700, "Yin-So Chen" wrote:<br>> Yes, I don't really want #%top per se. My scenario is to "alias" an<br>> imported id (
i.e. not something privately defined by the module) and it<br>> looks more like below:<br>><br>> > (module foo mzscheme<br>> (define bar (lambda (x) x))<br>> (provide bar))<br>> > (begin<br>
> (require (prefix baz: foo))<br>> (define bar baz:bar))<br>> > baz:bar<br>> #<procedure:bar><br>> > bar<br>> #<procedure:bar><br>><br>> Aliasing allow me to "trace" and set over the alias (
<br>> <a href="http://list.cs.brown.edu/pipermail/plt-scheme/2007-March/016927.html">http://list.cs.brown.edu/pipermail/plt-scheme/2007-March/016927.html</a>). So I<br>> extracted the exported variables for a module (
<br>> <a href="http://list.cs.brown.edu/pipermail/plt-scheme/2003-November/003698.html">http://list.cs.brown.edu/pipermail/plt-scheme/2003-November/003698.html</a>) and<br>> attempt to do write a macro that would automatically alias them, but all of
<br>> the variables gets expanded to (#%top . variable) form, while if I manually<br>> write it out like above, it is "ok".<br><br><br></blockquote></div><br><br clear="all"><br>-- <br><a href="http://www.yinsochen.com">
http://www.yinsochen.com</a><br>...continuous learning...