Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

GNU c can have lambda expressions[1]. And clang does even have closures[2].

1: http://walfield.org/blog/2010/08/25/lambdas-in-c.html

2: https://en.wikipedia.org/wiki/Blocks_(C_language_extension)



Note that the first example relies on multiple GCC-only features, one of which is the atrocity that is nested functions, and even then technically invokes undefined behavior.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

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

Search: