[cfe-dev] blocks and lambdas

James Gregurich bayoubengal at me.com
Tue Feb 8 23:57:34 PST 2011


I'm not interested in stepping on anyone's favorite technology. If you love Blocks and gnustep that is wonderful!

lambdas are part of the C++0x standard. Therefore, it is a mechanism all C++ compiler vendors will eventually support. My company does commercial desktop development and the "cross-platform" that matters to us is Macintosh gcc/clang and Visual-C++. It is highly unlikely that Microsoft will ever support Blocks (they don't even support C99)...particularly given they have already implemented lambda support in VC++. Therefore, it is in my interest to make sure Apple's tools offer first-class support for as many standard C++ technologies as possible so that my development burden is eased. I envision that lambdas will be a big part of my future and I wanted find out what direction clang is taking on lambda support.


-James

Sent from my iPad

On Feb 8, 2011, at 3:56 PM, David Chisnall <theraven at sucs.org> wrote:

> On 8 Feb 2011, at 21:39, James Gregurich wrote:
> 
>> given the lambda is the cross-platform standard, I think being able to pass the lambda to the Cocoa callback-using APIs and to libdispatch is the useful situation
> 
> 
> I'm not sure what this means.  Blocks are also a cross-platform solution.  We shipped a working blocks runtime as part of √Čtoil√© six months before Apple shipped theirs, and it's now been incorporated into GNUstep.  I've used blocks on OS X, FreeBSD, OpenBSD, Solaris, and Linux.  Apple (more recently) released their blocks runtime as part of LLVM's compiler-rt project, so you can use blocks without an Objective-C runtime, if you choose.  
> 
> Blocks are a cross-platform solution, they're just not well supported by other compilers yet[1], but they're quite useable on a variety of platforms.
> 
> David
> 
> [1] Actually, they're not well supported by clang yet either - we allocate too many structures for __block variables.
> 
> -- Sent from my PDP-11
> 




More information about the cfe-dev mailing list