Skip to content

Instantly share code, notes, and snippets.

@landonf
Created October 27, 2010 17:53
Show Gist options
  • Save landonf/649576 to your computer and use it in GitHub Desktop.
Save landonf/649576 to your computer and use it in GitHub Desktop.
An Objective-Not-C with type inference might look like ...
@implementation Logger
- (void) writeToLog: (NSString) message {
NSLog("%@", message);
}
@end
/* infer the types */
val printer = ^(str) {
[self writeToLog: str];
}
vs.
/* explicitly declare the types */
void (^printer)(NSString *) = ^(NSString *str) {
[self writeToLog: str];
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment