Skip to content
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

Rewrite the SyntaxExtension/Hygiene chapter #40

Open
Veykril opened this issue Jul 13, 2021 · 1 comment
Open

Rewrite the SyntaxExtension/Hygiene chapter #40

Veykril opened this issue Jul 13, 2021 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@Veykril
Copy link
Owner

Veykril commented Jul 13, 2021

It's really not great atm but I'm currently having trouble going into the topic without touching macro_rules!/proc-macro specifics, https://veykril.github.io/tlborm/syntax-extensions/hygiene.html

Basically after #43 lands, the hygiene subchapter of the syntax extension chapter is still a lot worse than the declarative macros one. Feels like a lot of information from the declarative one should be lifted into the syntax extension one?

@Veykril Veykril added the help wanted Extra attention is needed label Jul 13, 2021
@Hasnabruzzn
Copy link

Just opened #78 on the duplicated evaluation problem, which might be part of the hygiene chapter.
What is so bad about the chapter?
What I got from it is:

  • it's bad to rely within the macro on things defined outside the macro (like assuming a specific variable is there)
  • it's bad to change the things outside the of the scope of the macro (like creating variables)
  • Rust allows you to do those bad things, so you are responsible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants