<https://github.com/mgood7123/kpp>
# feed
s
a
You really want to bring the worst of C/C++ world to kotlin?
s
Maybe? XD
At least only #define usage, other stuff is optional
a
It is really terrible. You'd better spend your time learning the language ant its way to solve those problems.
s
How is it terrible o.o
a
The preprocessor breaks all tooling and makes the program behavior unpredictable. You should start by defining what problems do you want to solve with your tool (in #general). I am sure you will be immediately pointed in the right direction about how to solve it in Java/Kotlin world.
s
Ok
Also how would I detect such unpredictable behavior, and what are some examples of this unpredictable behavior
a
It seems obvious for me, but there is a lot of discussions about it. Like this question: https://stackoverflow.com/questions/14041453/why-are-preprocessor-macros-evil-and-what-are-the-alternatives
s
Ok, I'll try to see if I can address some of those problems so that hopefully they would not be a problem
For example, I could change how the macro's are detected so that the user can easily tell if x is a macro or not, among other things such as attempting to rewrite the user's code during processing for (x++) cases, so it behaves as expected
Aswell as, possibly replacing macros containing an if ... with a method then replacing the macro with a method call and so on
Though I probably cant do any of that yet untill I figure out how to prevent infinite recursion in macro expansions
c
I’m curious why you’d need preprocessor macros when kotlin natively supports inlined functions, which seem to have a similar effect?
s
dunno, lazy i guess lmao