Hacker News new | past | comments | ask | show | jobs | submit login

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/ and here: http://theorangeduck.com/page/c-preprocessor-turing-complete




Not 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.


Yeah 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.


The C preprocessor, combined with the EVALn macros, is Turing-Complete-up-to-N-iterations, so not quite a bar stool.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: