I thought function pointers were a well known part of C. How long can you program C before needing to call qsort or similar? Or before you encounter (or create) your own method table?
GLib offers closures in C; I've never used them, though, and they don't look very convenient.
Re:List Processing in C
by JoachimSchipper on Tuesday December 21, 2010 @05:01AM
(#2027421)
That's not standard C, though.
That's why it says 'Apple's blocks' and not 'C99 blocks' or 'C1X blocks'. Though, it is part of mainline clang, so it is not restricted to OS X in any way.
Of course blocks also requires runtime support. The compiler is useless without a matching runtime library. Is there a production-quality "C-with-blocks" runtime available for other platforms than OS X?
Re:List Processing in C
by memoryhole on Tuesday December 21, 2010 @07:00AM
(#2027555)
I'm not sure if it is production quality, but I have successfully used this to get C-with-blocks in Archlinux. http://compiler-rt.llvm.org/index.html
Perhaps more interesting and newsworthy in this context are Apple's blocks, which are closures:
http://thirdcog.eu/pwcblocks/