On Apr 15, 2016, at 12:47 AM, Andrey Tarantsov <and...@tarantsov.com> wrote:
> Chris,
>
>> Given all this, I think it makes sense to go for syntactic uniformity
>> between parameter list and function types, and just require parenthesis on
>> the argument list. The types above can be trivially written as:
>>
>> (Int) -> Float
>> (String) -> ()
>
> I don't care about this particular question too much, although I still prefer
> less parenthesis where possible.
>
> But I fear that going this way, we'll soon arrive at requiring parenthesis
> for the block arguments:
>
> do_something { foo in
> ...
> }
>
> and that (the parenthesis in blocks) is something I would love to avoid.
I see your concern, and while someone might propose that, I would be pretty
strongly against it. The closure parameter syntax is already magical in many
ways (e.g. you can elide the "-> ReturnType” before in, so I don’t see a reason
to mechanically force alignment with type syntax. Further, closures are
written much more often than function types, so terseness is a lot more
beneficial.
-Chris
_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution