In article <9ab217670909020720x6642f30fmaf855420f3d99...@mail.gmail.com>, Devon H. O'Dell <devon.od...@gmail.com> wrote: >2009/9/2 Uriel <urie...@gmail.com>: >> On Wed, Sep 2, 2009 at 10:04 AM, Anant Narayanan<an...@kix.in> wrote: >>> Mac OS 10.6 introduced a new C compiler frontend (clang), which added >>> support for "blocks" in C [1]. Blocks basically add closures and anonymous >>> functions to C (and it's derivatives). Full details with examples are in the >>> linked article. I think the feature is quite elegant and might be useful in >>> cases where you want map/reduce like functionality in C. >> >> Er., I might be more dumb than usual, but why on earth would you >> need/want this garbage to get map/reduce functionality in C? >> >> To me it seems the typical "lets come up with some cute 'feature' and >> then we will figure out how to hype ourselves all the way to hell". > >I don't see why you'd particularly need / want this in C, but the >argument here seems silly given that you've stressed your affinity to >other languages that implement closures / anonymous functions. > >In any case, implementing closures in C isn't too difficult, and if >you want to return a function, just return a pointer to it.
That is definitely part of the counter issue, OTOH, the counter-counter issue :) is in part to not have to worry about those pointers, especially when lots of smaller functions and pointer to functions may be concerned. -- Greg Comeau / 4.3.10.1 with C++0xisms now in beta! Comeau C/C++ ONLINE ==> http://www.comeaucomputing.com/tryitout World Class Compilers: Breathtaking C++, Amazing C99, Fabulous C90. Comeau C/C++ with Dinkumware's Libraries... Have you tried it?