[swift-evolution] [Pitch] Retiring `where` from for-in loops
Vladimir.S
svabox at gmail.com
Tue Jun 14 11:18:35 CDT 2016
FWIW I don't think we need all "4", just like we don't need `unless` as a
pair to current `if` or `until` as a pair for current `while` loop.
I.e. we have "continue" with current `where`, and you can use boolean
inversion `!`. As for "break"(while) - my opinion the for-in loop will be
more powerful and adds fun for coding (from wwdc keynote - "Swift is a
powerful language.. writing Swift code is *fun*..." my opinion: using
guard-continue or guard-break is *not* fun ).
So in your words, it is better add *one* then remove *one*.
The only question I'm not sure about if we should keep 'where' and 'while'
keywords for these features, or rename them. For me it's OK to have 'where'
and 'while' but probably I'll support another more clear keywords.
On 14.06.2016 18:01, Erica Sadun via swift-evolution wrote:
>
>> On Jun 14, 2016, at 7:50 AM, plx via swift-evolution <swift-evolution at swift.org> wrote:
>> For those particular keywords, I’d prefer having them (or equivalents). I’m not sure if I’d prefer having *all* of them—`where/unless` and `while/until`—or just one from each “pair”…I could go either way.
>
> In the proposal, my recommendations for including all 4 are:
>
> break: while / until
> continue: if (formerly `where`) / unless
>
> As the thread has had sufficient redundancy, I'll refrain from making my case again for why I think it's better to remove the one than add the three.
>
> -- E
>
>
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
>
More information about the swift-evolution
mailing list