Imagine I have this macro that injects a symbol into its environment.
(macro inject [] `(local foo# 10))
(inject)
;;prints 10, but *should* be `unknown identifier: foo_2_auto` or print `nil`
(print foo_2_auto)
I'm not an expert on macro hygenics, but in my mental model, I would expect foo#
to be in scope, but be unnameable and inaccessible.
Unexpectedly, if you can predict the generated name, (in this case foo_2_auto
) you can gain access to the local.
I haven't thought this thru all the way, but I think the only way to prevent this is to make it so that
foo#
does not expand tofoo_2_auto
until right before it's emitted as Lua. However, this may cause backwards-incompatibility issues with existing macros.