macro_rules!foo { (x => $e:expr) => (println!("mode X: {}", $e)); (y => $e:expr) => (println!("mode Y: {}", $e)); }
fn main() { foo!(y => 3); // mode Y: 3 foo!(x => 2); // mode X: 2 } How is it possible to simulate in D?
Dennis Ritchie via Digitalmars-d-learn Fri, 05 Jun 2015 06:05:53 -0700
macro_rules!foo { (x => $e:expr) => (println!("mode X: {}", $e)); (y => $e:expr) => (println!("mode Y: {}", $e)); }
fn main() { foo!(y => 3); // mode Y: 3 foo!(x => 2); // mode X: 2 } How is it possible to simulate in D?