Are there macro facility for Java or C#?
- by h2g2java
Macros are useful.
Therefore, I occasionally bemoan the absence of macros in Java and C#. Macros allow me to force in-line but allow me the code-manageability of non-macro code.
Is there any Java- or C#-based project/product somewhere out there that effectively allow macros or specifying in-line expansion.
I am thinking of something like
@macro public void hello(int x){ ... }
or when I call a method, an @inline annotation preceding the call would effect the called-method to be in-lined.
or, should I need to know that I should just trust the compiler to make the best the decision for me that at the best of its analysis it might in-line a call.
I hope this question will not lead to debating the pro/cons/usefulness of macros.