But that’s a valid argument that implementing every language feature as macro first is unnecessary.
We already have nightly channel for testing new syntax / features. In this way users would have first class syntax, and there wouldn’t be any migration headache. I also would be more ergonomic, so in this form it could attract more users for testing.
I can wait as long as it will be required - that’s not a problem. I know that the language team is currently busy and that this feature couldn’t be in priority in near future. It could be rejected at all - that’s fine.
Everything I want currently - to represent this idea as best as possible.
Probably the most important reason that I don’t like macro implementation is that I don’t have too much experience with macros and currently I don’t know how to implement exactly the same syntax using them:
- how to inject
it keyword into expression and restrict it scope to single level?
- how to return last value depending on presence of comma?
It don’t looks trivial, and I don’t know what pitfalls here could be. It would require a lot of investigation.
Also, I trying to avoid custom macros when possible and I wouldn’t use it in any real world code. For testing purposes it’s always enough for me to rewrite some snippet with desired syntax. I fear to promote a macro solution to community because it easily can create wrong impression, especially if there wouldn’t be any way to provide the same guarantees as in original proposal.
Also, it would be honest to say that I’m not motivated enough for it.
It don’t looks that bad. But it looks more complex than all other macros included in Rust. If someone will implement it as separate crate preserving all properties of this construct - that’s ok. However, I don’t think that it would be suitable as final solution that should be included into Rust.
Code with macros is harder to understand. Macros aren’t beginner friendly. They have problems with error reporting. They have problems with IDE.
IMO, this macro might will introduce more problems than solve.