- briksoftware Blog - https://briksoftware.com/blog -

Blocks in Objective-C

There have been quite a lot of news about blocks in C recently. What I wonder however is: will there be a Objective-C block object that wraps such a new C block?

Thing is: You can’t send messages to C-Blocks, they’re just as primitiv as an int, or a float, even if they’re more complex. In Obj-C you also have string literals like @”a string”, which you can send messages to. Why not also have literal blocks like @[:arg | arg doSomething]? I think that would really make live a bit easier sometimes.

@[:arg | arg doSomething] might look a bit too smalltalkish for some people, but on the other hand the selectors in Obj-C also look just as cool as in Smalltalk.

Anyway, looking forward to seeing blocks in Cocoa.

Karsten