[swift-evolution] Closure Syntax

Charles Srstka cocoadev at charlessoft.com
Fri Jan 1 18:41:15 CST 2016


> On Jan 1, 2016, at 5:05 PM, Chris Lattner via swift-evolution <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.

Charles
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160101/a92516cf/attachment.html>


More information about the swift-evolution mailing list