I’ve been working on Asterism for quite a while now, but I only recently got around to put up proper documentation.

Asterism is a functional toolbelt that uses overloaded C functions to unify its API. This allows you to use the same method for different data structures and block types:

ASTEach(@[ @"a", @"b", @"c" ], ^(NSString *letter) {
    NSLog(@"%@", letter);

ASTEach(@[ @"a", @"b", @"c" ], ^(NSString *letter, NSUInteger index) {
    NSLog(@"%u: %@", index, letter);

ASTEach(@{ @"foo": @"bar" }, ^(NSString *key, NSString *value) {
    NSLog(@"%@: %@", key, value);

It supports all the usual methods for NSArray, NSDictionary, NSSet and NSOrderedSet.

You can check out Asterism on GitHub and of course, install it through CocoaPods.

Posted May 23, 2014 in working-on