bsideup / groovy-macro-methods-proposal

Apache Groovy proposal of macro methods implementation
Apache License 2.0
9 stars 0 forks source link

Syntax #1

Open bsideup opened 8 years ago

bsideup commented 8 years ago

Currently, macro methods have the same naming semantic as normal methods. But it means that it's unclear whenever a call is a macro call or not. Plus, in a case of clashing macro methods always win because they are replaced at compile time, not runtime.

Another option would be to use special notation for macro calls, i.e. like Rust did: https://doc.rust-lang.org/book/macros.html

they annotate macro method call with !, so it's always clear:

foo() // standard method
foo!() // macro method

But this will require grammar change.