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

Macro reform #416

Closed
glaebhoerl opened this issue Oct 26, 2014 · 3 comments
Closed

Macro reform #416

glaebhoerl opened this issue Oct 26, 2014 · 3 comments

Comments

@glaebhoerl
Copy link
Contributor

At some point, possibly after 1.0, we may want to reform the macro system.

Wishlist items which come up frequently include:

  • Having macros be namespaced and scoped under modules the same way as other items are, e.g. one could write std::io::println!("hello world").
  • Full hygiene for all items mentioned in macro bodies. (Currently one must write the fully qualified path for items in macros.)
  • The ability for macros to refer to private items visible at their definition site, allowing them to be a tool for abstraction, not just convenience.

(The latter two might potentially be accomplished by having all name resolution in macro_rules! bodies happen at the definition site. This article may also be of interest.)

@brendanzab
Copy link
Member

Having macros be namespaced and scoped under modules the same way as other items are

I have spoken to @jbclements about this before, and he believes that this is possible. Not sure the specifics though.

@kmcallister
Copy link
Contributor

I wrote up some of my reform ideas, focusing on things we could plausibly do before 1.0. I'm turning this into a proper RFC.

@glaebhoerl
Copy link
Contributor Author

Closing in favor of #440.

wycats pushed a commit to wycats/rust-rfcs that referenced this issue Mar 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants