You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Chapter 17.3 DSL: Curly braces in macro invocation #1956
macro_rules! calculate {(eval $e:expr) => {{let val:usize = $e;// Force types to be unsigned integers
println!("{} = {}", stringify!{$e}, val);}};}
what is the implication of using curly braces with stringify! ? Looks like those do not change program behaviour in any way, compared to normal parentheses.
Submitted #2045 with a short explanation of the delimiter choices and statement semicolons. The original example is unchanged, and chapter tests, five language builds/link checks, and compiled delimiter variants pass locally.
Activity
Kivooeo commentedon Sep 9, 2025
You can use any braces for macros, there is no actual difference
I'm not sure if we explaning this somewhere, and I also dont know why, just randomly found this
Does it worth mentioning?
Feliksas commentedon Sep 9, 2025
probably worth mentioning, since it creates an impression of some kind of special case or implied special meaning in the current context
TXyy2023 commentedon Oct 18, 2026
Submitted #2045 with a short explanation of the delimiter choices and statement semicolons. The original example is unchanged, and chapter tests, five language builds/link checks, and compiled delimiter variants pass locally.