4 ms·
It can be a bit tricky if it isn't integrated with the build process.
by uxcn 11y ago
It can be a bit tricky if it isn't integrated with the build process.
- Kristine1975 11y agoYou can use e.g. cog which puts the generated code into the file itself: http://nedbatchelder.com/code/cog/ http://nedbatchelder.com/code/cog/ Then all you need to do is to remember to run the preprocessor after you've made a change to the generator code.
- uxcn 11y agoPython is definitely a better syntax to write meta-programs than the pre-processor, but you still have the issue of the additional step/tool. Anything that depends on the generated code depends on the step which, if it's missed, can lead to non-good things.
- Kristine1975 11y agoSure. But you do test your changes, don't you? ;-) So if you forget to run cog after making a change to the meta-program, you should notice right away. But it still is a cludge. It would be better if C/C++ had a better preprocessor.
- uxcn 11y agoIt isn't a question of testing changes. The more people working on the codebase, the more people it impacts. Adding manual steps is tempting the fates.