This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] Apple Blocks extension



> On Nov 3, 2013, at 9:10 PM, Ian Lance Taylor <iant@google.com> wrote:
> 
>> On Sun, Nov 3, 2013 at 8:49 PM,  <pinskia@gmail.com> wrote:
>> 
>> 
>>> On Nov 3, 2013, at 8:28 PM, Maxim Kuvyrkov <maxim@kugelworks.com> wrote:
>>> 
>>> Hi,
>>> 
>>> I am considering a project to add Apple's blocks [*] extension to GCC.  I am looking at adding blocks support to C, C++ and Obj-C/C++ front-ends.
>> 
>> What benefits does blocks have over nested functions in C and over lambas in C++?  I think it is wrong to add another extension if only to be compatible with clang.  I also think the blocks extension are less useful than nested functions and lambas.  The question really should be why support something which has no advantage to them to what is already existing.  I think it was wrong for apple to add them in the first place.
> 
> Clang's blocks are more powerful than GCC's nested functions, because
> blocks may be placed on the heap, and therefore returned from a
> function.

Actually I think it is less powerful since it is a copy rather than a reference.  Then again lambas can be do both.


> 
> Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]