<div dir="ltr"><div><div>Matt, Asumu,<br><br></div>Thank you, I had noticed and become confused by the same thing Greg brought up with plain-app in the expression grammar. I'll have to start paying more attention to the asides in the Reference. <br>
<br>At any rate, your help got me rolling again. It turns out that the annotate function can handle the expanded syntax from my last email with no problems - so I guess the pattern match uses free-identifier=? when looking for #%plain-app. I'm going to have to investigate why this works on syntax from a call to expand but not within the transformer of a define-syntax macro, but I'm no longer totally stumped.<br>
</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jan 21, 2014 at 10:23 PM, Asumu Takikawa <span dir="ltr"><<a href="mailto:asumu@ccs.neu.edu" target="_blank">asumu@ccs.neu.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 2014-01-21 22:00:37 -0500, Greg Hendershott wrote:<br>
> I get:<br>
><br>
> '(module foo scheme<br>
> (#%module-begin<br>
> (define-values (a) '3)<br>
> (#%app call-with-values (lambda () (#%app + a '4)) print-values)))<br>
<br>
</div>I think what's happening here is that the symbolic name of an identifier<br>
often does not reflect the actual binding of the identifier.<br>
<br>
In particular, consider this interaction:<br>
<br>
-> (define stx (parameterize ([current-namespace (make-base-namespace)])<br>
<div class="im"> (expand<br>
(datum->syntax<br>
#f<br>
'(module foo scheme<br>
(define a 3)<br>
(+ a 4))))))<br>
</div> -> (define id (syntax-parse stx [(_ _ _ (_ _ _ (?#%app _ _ _))) #'?#%app]))<br>
-> (free-identifier=? id #'#%app)<br>
#f<br>
-> (free-identifier=? id #'#%plain-app)<br>
#t<br>
<br>
IOW, the ground truth is reflected by `free-identifier=?` but not the<br>
name. In particular, note this bit from the margin note in Section<br>
1.2.3.1 of the Reference:<br>
<br>
Beware that the symbolic names of identifiers in a fully expanded<br>
program may not match the symbolic names in the grammar. Only the<br>
binding (according to free-identifier=?) matters.<br>
<br>
Cheers,<br>
Asumu<br>
<div class="HOEnZb"><div class="h5">____________________<br>
Racket Users list:<br>
<a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
</div></div></blockquote></div><br></div>