[swift-evolution] repeat loop enhancement
Tyler Cloutier
cloutiertyler at aol.com
Wed Dec 9 15:21:47 CST 2015
Likely because
for 1…5 {
}
is the same as
for 2…6 or for 0…4
which is confusing.
Tyler
> On Dec 9, 2015, at 1:20 PM, Sean Heber via swift-evolution <swift-evolution at swift.org> wrote:
>
> This seems like the most sensible thing to me - if you don’t need the variable, just leave it out! Nice and clean and no confusion.
>
> l8r
> Sean
>
>
>> On Dec 9, 2015, at 3:18 PM, Brent Royal-Gordon via swift-evolution <swift-evolution at swift.org> wrote:
>>
>>>> for x in 1...5 {
>>>> … some code…
>>>> }
>>>
>>> for x in 1…5 - what does 1 … 5 mean? What does it mean for x to be in 1 … 5? Now you tell me x isn’t in 1 … 5 and I can replace x with _ what does it mean for _ to be in 1 … 5 and why do I need _ at all? _ isn’t in the loop either. What’s a loop?
>>
>> You know, I look at this and wonder, why can’t you just say `for 1…5`?
>>
>> --
>> Brent Royal-Gordon
>> Architechies
>>
>> _______________________________________________
>> swift-evolution mailing list
>> swift-evolution at swift.org
>> https://lists.swift.org/mailman/listinfo/swift-evolution
>
> _______________________________________________
> 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