> On Dec 30, 2018, at 3:13 PM, Jonathan Simpson <jjsim...@gmail.com> wrote:
> 
> Adding a '(provide type)' in expander.rkt (where 'line' is defined) gets me 
> past this error. Strangely, providing 'compare' or 'offset' doesn't seem to 
> be necessary. I'm interested in any theories as to why this might be the case.

Without seeing "reader.rkt" or "expander.rkt" — I'd guess that:

1) `read-syntax` isn't stripping all bindings from its parse tree before 
returning it. Though this isn't mandatory, it's a wise practice to avoid 
mysterious binding problems like this one. (Use `strip-context` in 
`syntax/strip-context`.)

and 

2) your list of literals in the `line` macro is stricter than you intend. Macro 
literals match by datum AND binding, not merely by datum. So if you say 
`(offset type test message)`, and you have `type` defined outside the macro, 
then the literal will only match uses of that particular binding of `type`. 
This is why `(provide type)` seems to fix the problem — you're injecting the 
binding the macro pattern wants into the source environment. Again, though 
Racket won't forbid you from managing bindings this way, it can become a 
tangled web.

-- 
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 racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to