[swift-evolution] [swift-evolution-announce] [Review] SE-0099: Restructuring Condition Clauses
Thorsten Seitz
tseitz42 at icloud.com
Tue May 31 10:02:57 CDT 2016
Like some others on this list I prefer the `where` because it stands out and therefore increases readability by visually separating semantically different clauses.
-Thorsten
> Am 31.05.2016 um 07:10 schrieb Xiaodi Wu <xiaodi.wu at gmail.com>:
>
> Of course, an alternative is to eliminate `where` for all uses of `case` as well.
>> On Mon, May 30, 2016 at 11:55 PM Thorsten Seitz via swift-evolution <swift-evolution at swift.org> wrote:
>>
>> > Am 29.05.2016 um 17:11 schrieb Thorsten Seitz via swift-evolution <swift-evolution at swift.org>:
>> >
>> >
>> >> Am 28.05.2016 um 22:35 schrieb Chris Lattner <clattner at apple.com>:
>> >>
>> >>
>> >>> On May 28, 2016, at 12:07 PM, Thorsten Seitz <tseitz42 at icloud.com> wrote:
>> >>>
>> >>> What about requiring `let` before each binding and `case` before each pattern?
>> >>>
>> >>> guard case let x = a, case let y = b, let z = c, x == y else { … }
>> >>>
>> >>> Now `let z = c` can only be a let-binding and not a pattern matching clause.
>> >>
>> >> Yes, that would be enough to solve the ambiguity. The problem with that is that it eliminates a commonality with var/let declarations, which can declare multiple variables.
>> >
>> > var/let declarations are sufficiently different from let-bindings IMO that this commonality could be dropped.
>>
>> In addition the proposal would result in eliminating a commonality of `case` clauses allowing a `where` clause everywhere except in conditional clauses which is worse.
>> I'd much rather prefer to drop the commonality with var/let declarations!
>>
>> -Thorsten
>> _______________________________________________
>> swift-evolution mailing list
>> swift-evolution at swift.org
>> https://lists.swift.org/mailman/listinfo/swift-evolution
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160531/d855bbef/attachment.html>
More information about the swift-evolution
mailing list