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

I was, and continue to be, very disappointed that the (to me) more natural and C-like block syntax for lambdas was rejected from C11 (http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2030.pdf).


In practice those signatures can get a bit tiresome to write out, but I agree, they fit much, much better with C syntax and mindset.


Certainly, but no more tiresome than the existing C syntax for function pointers, to which they were direct analogues.


Yes, agreed absolutely. I think they'd be used more heavily because of the convenience of allowing captures, though.


I think that idea is pretty cool. I don't like the new closure pointer type, and how all functions that take function pointers need to be retrofitted to take closures as well, but I guess it's necessary. I assume closure pointers would be implemented as a double pointer, one void* to point to the captured variables in memory, and one function pointer to point to the procedure. One of the most annoying parts of C is how callback logic needs to be defined completely separately from the calling logic.


I’m not sure, im no compiler programmer but I prefer not requiring an allocator like malloc and copying data and reference counting. But I don’t know.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

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

Search: