>
> #+begin_src racket
>   ;; inside syntax-parse
>   (datum->syntax this-syntax '<~)
> #+end_src
>
> Notice that the second argument to datum->syntax should be a symbol here, 
> rather than a syntax object. If you provide a syntax object as you did in 
> your original code, datum->syntax simply returns that syntax unchanged.
>

Damn, you totally caught it! Indeed, I was an idiot and used syntax where 
symbol was meant. Thank you
 

> I don't expect using syntax-local-introduce will work reliably; before the 
> change to the scope sets model of hygiene in Racket 6.3 it was another way 
> to accomplish this purpose, but no longer.  For example, it breaks when the 
> macro introducing the binding and its use are in different modules. Below, 
> (m introduced) works in a but fails in b.
>

And this totally makes sense now that, thanks to your example, I've seen 
the error msg its produced. Indeed, the two sets of scopes differ, so you 
end up with an unbound identifier there. Also confirmed with my own 
implementation and switched it back to datum->syntax as you suggested above 
and now escape with <~ works as expected. At least the error matches my 
mental model even if this means I no longer understand the purpose of 
syntax-local-introduce.

I think I ought to re-read the syntax model chapter in docs and read the 
papers you mentioned. Maybe even make it a regular exercise :)

Thank you Michael

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/0c308260-d39f-4e84-9629-c0dea14ba6f1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to