Skip to content

Instantly share code, notes, and snippets.

@uliwitness
Last active August 29, 2015 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save uliwitness/99896362775beeefc813 to your computer and use it in GitHub Desktop.
Save uliwitness/99896362775beeefc813 to your computer and use it in GitHub Desktop.
The horrible syntax you need to declare a function that returns a block:
#include <stdio.h>
void (^blockreturner(void))( int a, int b )
{
return ^(int a, int b){ printf("%d %d\n",a,b); };
}
int main(int argc, char *argv[]) {
blockreturner()( 1, 2 );
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment