[swift-evolution] [Pitch] Retiring `where` from for-in loops

Vladimir.S svabox at gmail.com
Thu Jun 23 09:01:46 CDT 2016

On 23.06.2016 0:21, Erica Sadun via swift-evolution wrote:
>> On Jun 14, 2016, at 8:16 PM, Xiaodi Wu via swift-evolution
>> <swift-evolution at swift.org <mailto:swift-evolution at swift.org>> wrote:
>> As you will see from earlier messages, the confused user is both quite
>> real and *is* on this list. Nor, mind you, are pedagogical concerns to be
>> trivialized; they are serious concerns for the design of the language. On
>> what grounds do you assert that something is "not confusing at all" when
>> there has been testimony saying "it was confusing to me"?
>> Some of us on this list interact regularly with novice coders. I draw
>> upon these experiences here. Do you have some special insight you'd like
>> to share in that regard?
>> On Tue, Jun 14, 2016 at 20:57 Jon Akhtar <jona at herbalife.com
>> <mailto:jona at herbalife.com>> wrote:
>>     How about the goal of it being a delightful language to program in. I
>>     think that is getting lost in proposals like these. Optimizing for
>>     some mythical new user, who really isn’t present on this list to give
>>     an opinion seems like a false argument to make, and your technical
>>     sophistication makes you a less qualified than most to say what is
>>     and what isn’t confusing to new users because you haven’t been one in
>>     a long time.
>>     -1 Leve it in. It is perfectly simple as is. Not confusing at all.
>>     There are far more confusing aspects to the language than this.
>>     Cheers
> Yet another case from a few minutes ago:

Sorry.. but.. And what? Suggest <rullie> to write simple SQL query, will 
he/she be confused by 'WHERE' there? If <rullie> didn't know *for sure* 
what does 'where' means, why he/she didn't check docs or just checked in 
playground/IBM Swift Sandbox?

You found one more user confused by 'where'. I can find N users that were 
not confused by it even first time he/she saw it in code. And can find M 
users confused by any other construction/element of Swift. I just don't 
think such 'cases' could be treated as information that proves anything.

> rullie <member:rullie>: hi, could someone walk me through
> this http://pastie.org/10887040
> [3:08pm] rullie <member:rullie>: why is it that for loop through an lazy
> infinite sequence does not terminate even with the where clause invovled?
> [
> [3:08pm] mikeash <member:mikeash>: "where" means "skip iterations when this
> condition is not true"
> [3:08pm] mikeash <member:mikeash>: it doesn't mean "halt the loop when this
> is not true"
> [3:08pm] rullie <member:rullie>: oh whoa.. ok
> [3:09pm] mikeash <member:mikeash>: it can't know that you'll never see
> another value < 100, so <member:so> it keeps on going
> [3:09pm] rullie <member:rullie>: ok, i completely misunderstood the where
> clause then
> [3:10pm] mikeash <member:mikeash>: I can see how it might look like it does
> that
> [3:10pm] rullie <member:rullie>: is there a syntax that achieves what i
> want to do without having to have a if-break in the loop?
> -- E
> p.s. Posted with permission from both participants
> _______________________________________________
> 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