> On Dec 28, 2016, at 9:52 AM, Dave Abrahams <[email protected]> wrote:
>
>> it would be ambiguous to move the ‘throws’ keyword to the end of the
>> function type, because you'd get:
>>
>> let x : (_ a : Int) -> (_ b: Float) -> Double throws throws
>
> I see.
>
> We *could* say that the "throws" keyword comes after the return type
> unless it's a function type, in which case it comes after the return
> type's parameter list
>
> let x : (_ a : Int) -> (_ b: Float) throws -> Double throws
>
> I admit this is a horrible rule from a language designer's point of view
> but there's a chance it could end up being better for users.
Indeed this is horrid for an ivory tower language designer, but the pragmatic
among them often have to make concessions to the real world. That said, I
think this would be worse for typical swift programmers as well: it introduces
multiple ways to do things, which work inconsistently and surprisingly in some
cases.
Here is a different way of looking at this: The predictable case is the one we
already have now (and we wouldn’t take it away). Is your beef with the current
syntax so great that you think it is worth adding complexity to the language to
privilege some special cases?
-Chris
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution