<div dir="ltr">Thanks for taking a look, John.  Here's a reduced version.  I don't think there's any missing namespace information here at the time of evaluation, since the syntax is being manipulated in a macro, but I am relatively new to using namespace anchors, so I could be wrong. It seems to me like the syntax is being expanded either more or less fully than the annotator wants.<br>
<br>#lang racket<br>(require (for-syntax racket/format gui-debugger/annotator))<br>(define-syntax fail-to-annotate<br>  (lambda (stx)<br>    (let-values<br>      ([(annotated _)<br>        (annotate-stx (expand (cadr (syntax-e stx))) '_ '_ '_ )])<br>
      annotated)))<br>(fail-to-annotate (string-append "hi" "lo"))<br><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jan 20, 2014 at 2:18 AM, John Clements <span dir="ltr"><<a href="mailto:clements@brinckerhoff.org" target="_blank">clements@brinckerhoff.org</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"><br>
On Jan 16, 2014, at 4:05 PM, Patrick Boe wrote:<br>
<br>
> I am trying to learn how to use the DrRacket debugger's annotate function. My ultimate aim is to build a REPL that you can execute from within a closure and have access to everything that's in scope. (see my StackOverflow question on that topic and Greg Hendershott's well-researched answer) For the time being, I'm just trying to explore how the annotate function works. You can see my first exploratory attempt at using it, and the results, here.<br>

><br>
> The error, which is happing inside of the annotator, seems to arise when it tries to pattern-match he application of string-append. The matcher is looking for a #%plain-app and the expanded syntax I'm presenting to it contains an #%app. I'm unsure if I should be expanding the syntax differently so it comes out as a #%plain-app or if there's something else I'm doing wrong to produce the syntax I'm feeding into the annotator. Does anybody see where my error is?<br>

<br>
</div>Sadly, I don't have a browser right now, so I can't take a look at your links. Perhaps you can reduce it to a ten-line example? Could the solution have something to do with namespace anchors?<br>
<br>
John Clements<br>
<div class="im"><br>
><br>
> I originally posted this question to SO, but Greg suggested I might have more luck with it here.<br>
><br>
> Best,<br>
> Patrick<br>
><br>
> PS - if you're reading this, thanks the great PLAI class last year, SK!<br>
</div>> ____________________<br>
>  Racket Users list:<br>
>  <a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
<br>
</blockquote></div><br></div>