4 ms·
“Anything with an explanation point is a macro invocation, by the way.” Can you explain what this means, exactly?
by justwalt 6y ago
“Anything with an explanation point is a macro invocation, by the way.”
Can you explain what this means, exactly?
- deleted 6y ago[deleted]
- steveklabnik 6y agoThis 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.
- lalaithion 6y agofoo(x, y, z) is a function. foo!(x, y, z) is a macro.
- deleted 6y ago[deleted]
- jack1243star 6y agoNot OP, I think they mean the exclamation mark (!)
- gnosek 6y agoExclamation mark. e.g. println!("hello, world"); or todo!(); are macro invocations.
- ccktlmazeltov 6y agoprintln!("something") that's a macro
- staticassertion 6y agoMacros: #[Foo] struct Bar {} baz!() cat!{} blah![]