Thanks!! I was scratching my head trying to figure out where things went wrong and went down the define-macro path... thanks for pointing out my misunderstanding ;) <br><br>Very appreciated ;)<br><br>yinso <br><br><div><span class="gmail_quote">
On 4/24/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;">
At Tue, 24 Apr 2007 13:35:45 -0700, "Yin-So Chen" wrote:<br>> (define-syntax require-prefix<br>> (lambda (stx)<br>> (syntax-case stx ()<br>> ((_ req-clause)<br>> (with-syntax ((pref (datum->syntax-object stx (string->symbol
<br>> "a:"))))<br>> #`(require (prefix pref req-clause))))<br><br>The context of the `(prefix ...)' form determines the binding context<br>of the imports. So, you need to give the `(prefix ...)' part the
<br>original context.<br><br>Here's one way to do it:<br><br> (define-syntax require-prefix<br> (lambda (stx)<br> (syntax-case stx ()<br> ((_ req-clause)<br> (with-syntax ((pref-req-clause (datum->syntax-object
<br> #'req-clause<br> `(prefix a: ,#'req-clause)<br> #'req-clause)))<br> #'(require pref-req-clause)))
<br> ((_ req-clause rest ...)<br> #'(begin<br> (_ req-clause)<br> (_ rest ...))))))<br><br><br>Matthew<br><br></blockquote></div><br><br clear="all"><br>-- <br><a href="http://www.yinsochen.com">
http://www.yinsochen.com</a><br>...continuous learning...