" /> Ezra's Research: June 2009 Archives

« May 2009 | Main | July 2009 »

June 12, 2009

Dept. of Wheel Reinvention

From the brief on Apple's new concurrency framework, Grand Central Dispatch:

Blocks are a simple extension to C (as well as Objective-C and C++) that make it easy for you to define self-contained units of work. A block in code is denoted by a caret at the beginning of a function. For example, you could declare a block and assign it to x by writing:

    x = ^{ printf("hello world\n"); }
This turns the variable x into a way of calling the function so that calling x( ); in the code would print the words hello world.

What’s really powerful about blocks is that they enable you to wrap much more complex functions—as well as their arguments and data—in a way that can be easily passed around in a program, much as a variable can be easily referenced and passed.

Underneath this is a diagram showing that a block is like a function with some associated data.

I think I've seen this idea before somewhere. :-)

Ah, but a closure by any other name would smell as sweet...

June 8, 2009

Big Numbers

This is a good essay about big numbers by Scott Aaronson.

June 1, 2009

Quick beard note

Ahem.

It is not every 31-year-old who, in a first government job, finds himself dismantling General Motors and rewriting the rules of American capitalism. ... “He’s got this beard that appears and disappears,” says Steven Rattner, one of the leaders of President Obama’s automotive task force.

Emphasis mine.