return nil; };
DictBlock add(DictBlock d, id key, id obj) {
return ^id (id k) {
return [k isEqual:key] ? obj : d(k);
};
} DictBlock d = empty; d = add(d, @(1), @"abc"); d = add(d, @"def", @(5)); NSLog(@"%@ : %@", @(1), d(@(1))); NSLog(@"%@ : %@", @"def", d(@"def")); NSLog(@"%@ : %@", @(42), d(@(42))); 1 : abc def : 5 42 : (null)