

Using and Abusing Macros - dradtke
http://damienradtke.com/using-and-abusing-macros/

======
gus_massa
I use macros in Racket, and generally the idea is that they mix with the
language until its not clear which are the language constructions and which
are the user defined macros.

For example, instead of

    
    
      pub static SMITHY: Card = action! { "Smithy" costs 3 and calls do_smithy };
    

I’d written it as

    
    
      pub static SMITHY: Card = action! { "Smithy", 3, do_smithy };
    

Is this possible in Rust, or comas are special?

~~~
dradtke
It's absolutely possible. I actually implemented it the way I did more as an
experiment to see if it was possible, and when it turned out that it was,
decided that it was ridiculous enough to be awesome.

I probably wouldn't ever use a macro like this in code worked on by multiple
people, but for my own personal side project, I'm happy to abuse Rust's
flexibility for my own enjoyment.

