Skip to content

Instantly share code, notes, and snippets.

@davedelong
Last active December 19, 2015 01:39
Show Gist options
  • Star 10 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davedelong/5877529 to your computer and use it in GitHub Desktop.
Save davedelong/5877529 to your computer and use it in GitHub Desktop.
__block void(^block)(int) = ^(int i) {
printf("%d", i);
if (i > 0) {
block(i-1);
} else {
block = nil;
}
};
block(9);
// prints "9876543210"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment