
22 Dec
2007
22 Dec
'07
12:09 p.m.
Cristian Baboi wrote:
Let me show you an example to prove it.
That's not C. That's the C preprocessor, which is a textual substitution macro language. Macros certainly aren't first class (you can't pass a macro to a function, only its expansion). C does support function pointers, which are something like first class functions. The main things C lacks which people associate with true first-class function is: The ability to construct anonymous/local functions. The ability to capture local variables and return a function with some variables bound. The ability to write type-safe functions with polymorphic arguments. Jules