Feature Request: Will Kotlin support C++ macro? (#define)

Oh no, only not that. In my opinion, C-like Macros are a terrible legacy of procedural era. @Wasabi375 clearly showed that they could be easily replaced by global or local function. If you need macros in kotlin, it is a good indication that there is something wrong with your code.

Luckily, JetBrains team clearly stated that thy are not going to support macros because it is very hard (if not impossible) to provide good tooling for them. Meta-programming is on its way, but your example does not need it.

2 Likes