On Thu, Sep 29, 2016 at 12:23:16PM -0400, Ryan Culpepper wrote:
> >  ; /tmp/test.rkt:29.0: my-let: expected the identifier `begin'
> >  ;   at: quote
> >  ;   in: (my-let ((x 5)) x)
> >  ; Context: ....
> >
...
> The `quote` is coming from the local expansion:
...
> Meanwhile, you can also fall back to printf debugging using #:do
> side-clauses.
I did eventually figure out where the quote was coming from using printf 
debugging. The problem was I had no
idea where to start, because in a larger context with more complex macros it is 
really unclear why
"begin" was expected but "quote" was found in the expression "(my-let ((x 5)) 
x)", which does not
contain "quote" and does not use "begin" at the top-level pattern.
I think I would have had a lot less trouble debugging if the error message had 
said something about a
"#:with" pattern, or something that indicated it wasn't expected in the 
"(my-let ((x 5)) x)" directly
but in some refinement of the pattern.


> Would something like `debug-syntax-parse!` extended with Alex's proposal
> (https://github.com/racket/racket/issues/1377) for more debugging information
> have helped?
That looks great. Although, I also didn't know about "debug-syntax-parse!".

> >  ; /tmp/test.rkt:29.0: my-let: expected the identifier `lambda
> >  ;   at: lambda
> >  ;   in: (my-let ((x 5)) x)
> >  ; Context: ....
> >
> >So, we expected to see identifier that is there?
> >That's a strange error.
...
> I'll see if I can squeeze it into the error message that the identifier was
> expected to have a different binding.
I think this is an instance of larger problem; I ran into a similar problem 
with #%plain-app
being printed as #%app, and only now understand (thanks Alex!) what's really 
going on here.
I don't think it's specific to syntax-parse.

--
William J. Bowman

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Attachment: signature.asc
Description: PGP signature

Reply via email to