Closed yuanmai closed 11 years ago
whoops, hit reply too early
Yes, but categories should be prefixed, so you'd have
@[a, b, c].us_map(^(NSString *string) {
return string.capitalizedString;
});
which I don't find very pleasing, aesthetically. If prefer that, which I totally understand, check out BlocksKit, it uses categories and supports a similar functionality.
That being said, I have a branch where the wrappers are NSProxies, allowing you to skip the unwrapping, like so:
NSArray *myArray = _.wrap(@[foo])
.map(^(NSString *string) {
return string.capitalizedString;
})
.filter(^(NSString *foo){
// yadda yadda
});
Note that for the non-chaining use case you can already use
_.arrayMap(@[a, b, c], ^(NSString *string) {
return string.capitalizedString;
});
Thanks for your explanation.
Any reason to prefer wrapper over Category? Using category, we can achieve:
without any wrapping, right?