On May 27, 2016, at 5:35 PM, Brent Royal-Gordon via swift-evolution 
<[email protected]> wrote:
> 
>>              
>> https://github.com/apple/swift-evolution/blob/master/proposals/0099-conditionclauses.md
> 
>>      • What is your evaluation of the proposal?
> 
> Oof.
> 
> I am not a fan of this syntax. `;` reads very strongly as a statement ender 
> to me, and yet at the same time, it's still visually quite close to `,`. My 
> first impression was that the proposal had an embarrassing typo in the very 
> first example.
> 
> My suggestion would be to reuse our normal && operator:
> 
>       guard
>               x == 0 &&
>               let y = optional &&
>               z == 2
>               else { ... }


In theory because if/guard/when create a mini scope, this might be possible to 
use in this context but I'll defer to Chris to reply to the issue of whether 
it's a better separator. Keep in mind that the proposal doesn't update the 
grammar for each of the conditions so the following is possible

guard
  x == 0 && a == b && c == d &&
  let y = optional, w = optional2, v = optional 3 &&
   z == 2
else { ... }

Figuring out where to break the first line into expression and into condition 
(after the `d`) could be very challenging to the compiler.

-- Erica

_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to