upvote
yeah, lets be clear:

Most of the proc macros non-sense is to be able to annotate the enum or struct without wrapping it.

So that is why I use this hack:

https://docs.rs/macro_rules_attribute/0.2.2/macro_rules_attr...

P.D: Is there a true actually reason for proc-macros apart for this weird restriction?? And even if yes, how much nice things will be if this kind of scenario was already present so most not need to reach for proc-macros

reply
That's really cool, I was not familiar with this and will look into it!
reply
It's interesting seeing this discussion in Rust because it's the same discussion that's been happening around macros in Scheme for decades. It's one of those things where there probably is no universal correct answer, so might as well allow both in your language and let the programmer decide what's best for their case.
reply
Yea that's sound about right

The macro explained in that section was mainly for me to learn macros, and save up some boilerplate with nice syntax.

reply
Great writeup! Apologies if it came across as a criticism of the writeup itself, more of a frustration of years in the proc_macro space.

It's surprising how little information exists out there about proc_macros in general.

reply
Thanks!

Couldn't agree more, both on proc macros and operating system, I did not find sufficient information on the internet. That is exactly the purpose of this book.

reply
deleted
reply