
C preprocessor internals - g3orge
http://monoinfinito.wordpress.com/series/c-preprocessor-internals/
======
jacobparker
_Turns out the preprocessor is actually an organically grown pseudo language
(as opposed to a properly designed language feature) inside C, which later got
standardized through an incredibly complex set of rules and definitions._

This can be used to explain much of C. :)

------
ot
An impressive application of the C preprocessor is the Boost.Preprocessor
library [1]. It basically implements a primitive (and bounded) version of Lisp
_inside the preprocessor_.

I used it once to write DSLs to define data structures, where a few lines of
code were expanded to hundreds of lines of templates, (de)serialization code,
etc...

[1]
[http://www.boostpro.com/mplbook/preprocessor.html](http://www.boostpro.com/mplbook/preprocessor.html)

------
tensaix2j
This reminds me of one of the assignments in cppgm.org, where you get to
implement all those features.
[http://www.cppgm.org/pa4.html](http://www.cppgm.org/pa4.html)

~~~
octo_t
i like how one of the assignments is "read the C++ spec" o_O

