Are there macro facility for Java or C#?

Posted by h2g2java on Stack Overflow See other posts from Stack Overflow or by h2g2java
Published on 2010-04-17T01:41:58Z Indexed on 2010/04/17 1:53 UTC
Read the original article Hit count: 342

Filed under:
|
|
|

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.

© Stack Overflow or respective owner

Related posts about java

Related posts about c#