4 ms·
The C Preprocessor might be functional in the same sense as the lambda calculus but that's about it. And actually it isn't really: it needs to be supplied "eva
by norswap 12y ago
The C Preprocessor might be functional in the same sense as the lambda calculus but that's about it.
And actually it isn't really: it needs to be supplied "evaluations" to work. Evaluation is naturally recursive but cpp only performs one pass, so you need to explicitly request more evaluations (or "scans").
See here: http://pfultz2.com/blog/2012/05/10/turing/ http://pfultz2.com/blog/2012/05/10/turing/ and here: http://theorangeduck.com/page/c-preprocessor-turing-complete http://theorangeduck.com/page/c-preprocessor-turing-complete
- Peaker 12y agoNot being Turing Complete makes it less than the lambda calculus, which is still consistent with "purely functional". Purely functional is about expressive power you can't have, not power you can. So take the lambda calculus and restrict it, it remains purely functional.
- norswap 12y agoYeah right, but that makes a bar stool into a purely functional language as well; so the point is kinda pedantic. Not being able to recurse makes the language awful to use for almost everything excepted simple substitution, which is effectively what it is used for.
- Peaker 12y agoThe C preprocessor, combined with the EVALn macros, is Turing-Complete-up-to-N-iterations, so not quite a bar stool.