Show HN: Libpp – functional programming macros for the C preprocessor
github.com
github.com
Libpp's macros are implemented in a fashion similar to `P99_FOR`, but I think it's much cleaner. For example, `P99_FOR`'s handler macros are defined within a 10,000 line header file [3], and `P00_FOR_50` calls `P00_FOR_49`, so you're going to require as many preprocessor evaluations as arguments given. By contrast, `PP_MAP` is defined within a 300-line header file, and `PP_MAP_50` evaluates directly to the desired expression.
You can also change the argument limit of Libpp's macros to your liking, as detailed in the readme.
Libpp isn't as powerful or general as P99, but I'm finding it much easier to use. Perhaps that's just because I wrote it, though. Feedback would be really appreciated.
[0]: https://github.com/mcinglis/macrofun
[1]: https://pay.reddit.com/r/programming/comments/260cb6/macrofu...
[2]: http://p99.gforge.inria.fr/p99-html/group__preprocessor__for...
[3]: http://p99.gforge.inria.fr/p99-html/p99__generated_8h_source...
I've answered some questions about Libpp on /r/programming and /r/c_programming:
https://pay.reddit.com/r/programming/comments/27rutk/libpp_s...
https://pay.reddit.com/r/C_Programming/comments/27ru43/libpp...