Re:Rust 1.43
by steveklabnik on Thursday April 23, 2020 @12:37PM
(#22957838)
This is a function invocation:
foo(bar)
This is a macro invocation: foo!(bar)
It's done this way because macros can have much more complex things inside the ()s than functions can. This helps both humans and computers parse such things.
Re:Rust 1.43
by jack1243star on Thursday April 23, 2020 @12:38PM
(#22957849)
Not OP, I think they mean the exclamation mark (!)
TIL that “exclamation point” is region specific. Exclamation mark sounds subtly wrong to my ear.
I thought the confusion was that you wrote "explanation point" instead of "exclamation point".
Re:Rust 1.43
by lalaithion on Thursday April 23, 2020 @12:38PM
(#22957841)
foo(x, y, z) is a function. foo!(x, y, z) is a macro.
Re:Rust 1.43
by ccktlmazeltov on Thursday April 23, 2020 @12:41PM
(#22957877)
println!("something")
that's a macroExclamation mark. e.g.
println!("hello, world");
or todo!();
are macro invocations.
Re:Rust 1.43
by staticassertion on Thursday April 23, 2020 @01:37PM
(#22958542)
Macros:
#[Foo] struct Bar {}
baz!()
cat!{}
blah![]
Can you explain what this means, exactly?