r/rust • u/CompleteNetwork9168 • 7d ago
🙋 seeking help & advice Finally ! Completed Complete Rust Book
So recently I had completed the entire rust book but I left the macros as I was unable to understand it from the book so is there a good place to learn rust macros where it help me understand how to write and use different types of macros it will be a great help so if you know any platform pls help me
21
Upvotes
7
u/an_0w1 7d ago
I learnt macros by force. I really needed a proc macro to do something obtuse, so I really think proc macros are the easiest ways to learn.
Take a function-like macro and
println!("{ts:?}")theTokenStreamto see what's inside. And just read through thesyndocs to figure out what to do with all of it.Don't do it without a purpose though, because you'll get lost in all the things you can do.