Callables.h 770 B

123456789101112131415161718192021222324252627282930313233
  1. #import <Foundation/Foundation.h>
  2. typedef NSString *(^CALLABLE_TO_STRING)(id);
  3. typedef NSNumber *(^CALLABLE_TO_NUMBER)(id);
  4. typedef NSString *(^ACCUMULATOR_TO_STRING)(id, id);
  5. @interface Callables : NSObject
  6. + (id (^)(id))identity;
  7. + (NSString * (^)(NSString *))toUpperCase;
  8. + (NSString * (^)(NSString *, NSString *))appendString;
  9. + (ACCUMULATOR_TO_STRING)appendWithSeparator:(NSString *)separator;
  10. + (CALLABLE_TO_STRING)upperCase;
  11. + (CALLABLE_TO_NUMBER)increment;
  12. @end
  13. static CALLABLE_TO_STRING TL_upperCase() {
  14. return [Callables upperCase];
  15. }
  16. static ACCUMULATOR_TO_STRING TL_appendWithSeparator(NSString *separator) {
  17. return [Callables appendWithSeparator:separator];
  18. }
  19. static CALLABLE_TO_NUMBER TL_increment() {
  20. return [Callables increment];
  21. }