Open
Description
Issue by darkf
Thursday Aug 29, 2013 at 11:55 GMT
For earlier discussion, see rust-lang/rust#8853
This issue was labelled with: A-syntaxext, I-enhancement in the Rust repository
AFAIK there is currently no way to quote an operator such as +
or /
, and this would be useful to reduce code duplication.
Something like:
macro_rules! foo(
($oper:op) => 10i $oper 20i
)
fn main() {
printfln!("%d", foo!(+));
printfln!("%d", foo!(*));
}