<br><div class="gmail_quote">On Mon, Aug 9, 2010 at 6:00 AM, rafkind <span dir="ltr"><<a href="mailto:rafkind@cs.utah.edu">rafkind@cs.utah.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div></div><div class="h5"><br>
</div></div>You need a (require (for-template scheme/base)) in the 'literal.ss' file<br>
because the function is at phase 0 producing syntax at a lower phase (-1,<br>
which is template), so you need to import the bindings from scheme/base for<br>
that phase.<br>
</blockquote></div><br>Ah - that solved it. Thanks! <div><br></div><div>So does (begin-for-syntax ...) automatically manage the above for the function? I am trying to grok the difference but not sure if I got it: </div>
<div><br></div><div>1) when begin-for-syntax is used - the function is introduced in phase 1, which handles syntax matching at phase 0, so it works correctly</div><div><br></div><div>2) when (require (for-syntax)) is used - the function was defined in phase 0, but is imported into phase 1... would it not handle syntax matching at phase 0? </div>
<div><br></div><div>Then is it the case that for-syntax does not "shift" the phase of the function in question? So the function stays at phase 0 so it needs phase -1 defined. </div><div><br></div><div>3) Is it a best practice then all such module should all have (for-template ...) whether the functions have syntax-case literals defined? It seems that the syntax-case matches the syntax shapes if they do not involve literals (in the literal.ss it results in matching of both the empty and the if clause), i.e. the only time I've noticed it not working is when literals are involved. </div>
<div><div><br></div><div>Thanks. </div></div><div>yc</div><div><br></div><div><br></div>