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.
Quentin Carnicelli of Rogue Amoeba on Clang:
In short, Clang Static Analysis is like an extended set of compiler warnings for your code (C and Obj-C as of this writing). However, the Clang Checker has a vastly better understanding of your code than a compiler. It can detect memory leaks, double-frees, bad pointer references, and other such bugs that keep you up at night.
Looks like a must have tool for developing on Mac OS X.
