New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Variable binding (hygiene, gensym) not working in 2-level macros #760
Comments
If anyone wants a pointer on where this is in the codebase, the function However, I suspect there's a parsing error earlier in the compilation process, because after doing some research, I discovered that "hygienic macros" seem to be distinguished by the user not having to explicitly call |
Any updates on how to solve this? I've recently came across this problem as well. |
Variable binding in a 2-layer macro (i.e., a macro that calls another macro) is broken, in several cases I've tested.
Here's a fairly simple one (simpler than what I was using, but still clearly demonstrates the problem):
This should result in the value "42" being printed twice to stdout, but will actually result in a ReferenceError on the second console.log. The reason for this, is that Sweet.js expands it to the following code:
That
deep bar
appears to be misbehaving, as the identifierbar
is not picked up later on, during theconsole.log(bar)
call.The text was updated successfully, but these errors were encountered: