[swift-evolution] Closure Syntax
uchuugaka at icloud.com
Fri Jan 1 18:48:57 CST 2016
> On Jan 2, 2016, at 9:41 AM, Charles Srstka via swift-evolution <swift-evolution at swift.org> wrote:
>> On Jan 1, 2016, at 5:05 PM, Chris Lattner via swift-evolution <swift-evolution at swift.org <mailto:swift-evolution at swift.org>> wrote:
>>> On Jan 1, 2016, at 2:21 PM, Ethan Diamond <edgewood7558 at gmail.com <mailto:edgewood7558 at gmail.com>> wrote:
>>> FWIW I don't think the backlash to the use of ^ with Obj-C blocks was because of the carat itself,
>> Fair enough, different people have different objections. I’m sure some people love blocks syntax :-)
>>> but because of the inconsistency of the syntax in different contexts. Sometimes the return type was after the ^, sometimes before. Sometimes you had to use (^). Sometimes the carat had the name of the block with it ^functionName. None of it fit in with the [object methodName] syntax of the language itself.
>> No, it fit perfectly with C. Blocks are an extension to C, not technically an Objective-C extension.
> I wouldn’t say it fit perfectly. It matched C’s function pointer syntax, so it fit as well as that. However, C’s function pointer syntax is kind of horrible, so.
> Not that that is the fault of anyone on the Objective-C team, of course.
In the context of C, it is as good as it can be, and actually a bit nicer than some function pointers are, though you can always C your way to something nicer looking which the typedefs generally do (or if the old preprocessor define macros).
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution