29th August, 2008
Clang now has support for blocks, which are basically a way to bind stack variables to hidden structs and a pointer to a code block on runtime (link via John Gruber). It's very interesting to compare this approach to C++0x lambda functions. C++ takes the language way, by adding a new syntax to the language and making the feature depend heavily on templates and metaprogramming. Clang is primarily a C and Objective-C compiler and blocks are implemented with small syntax additions and a small runtime library that uses concepts such as reference counting. Very much like Objective-C.
