How Nested Functions Work, part 1

Daniel Keep daniel.keep.lists at gmail.com
Tue Sep 1 05:15:39 PDT 2009



Michel Fortin wrote:
> On 2009-08-30 17:34:36 -0400, Walter Bright <newshound1 at digitalmars.com>
> said:
> 
>> http://www.reddit.com/r/programming/comments/9fk6g/how_nested_functions_work_part_1/
>>
> 
> It's
>>
> true that C doesn't have nested functions, but Apple's version of C, C++
> and Objective-C, starting with Snow Leopard, has it. Well, it has nested
> function litterals, called blocks.
> 
> ...

Oh sod blocks; the REAL awesome in that example is Grand Central
Dispatch.  For those who don't know, it's a parallelism framework that
lets you farm off tasks to thread pools, with a few neat additions:

1) you can express dependencies and
2) the thread pools are managed by the OS itself, so it can load-balance.

No doubt Microsoft will have Windows Bismuth or something for Windows 9
that's a hard to use, missed-the-point knock off.  As for the FLOSS
crowd, I expect that in a year or so down the track their solution will
be buggy, even HARDER to use, and involve at LEAST three different and
completely incompatible libraries.

Plus, they have OpenCL.  I've seen about a half dozen OpenCL examples
specifically for non-Mac machines, but none bother to tell you how to
actually GET an OpenCL implementation, or if they're even available.  *sigh*

I loathe Macs, but Apple seems to have hit this particular feature out
of the park.



More information about the Digitalmars-d mailing list