GLUEscript uses a lot of macro's in the source code. While many developers find macro's evil, I find them useful for GLUEscript for the following reasons:
- They reduce a lot of repeating code
- They hide difficult to read code
- When something changes only the macro needs to be changed
The third reason is the most important reason for me: Between two versions of GLUEscript the prototype of a callback was changed. Instead of searching and replacing all code in the source files, I only needed to change the macro of the callback.
The last reason of using macro's is that I have a dream, that one day I write a parser that automatically translates C/C++ code into GLUEscript code. Parsing the syntax of macro's is easier then parsing C/C++ code.