> On Jun 12, 2017, at 5:13 PM, Pavol Vaskovic via swift-evolution 
> <[email protected]> wrote:
> 
> On Sun, Jun 11, 2017 at 1:52 AM, Haravikk via swift-evolution 
> <[email protected] <mailto:[email protected]>> wrote:
> 
> With the ability to specify throwaway variables more easily, I'm sticking 
> with my using syntax here:
> 
> var theNames:[String] = []
> while let eachItem = theIterator.next() using (var theTotal = 0) where 
> (theTotal < 100) {
>       theNames.append(eachItem.name)
>       theTotal += eachItem.value
> }
> 
> Depending upon your preference on how to structure the using and where parts 
> this is shorter and easier.
> 
> I think you just reinvented the C-style for loop, that was removed in SE-0007 
> <https://github.com/apple/swift-evolution/blob/master/proposals/0007-remove-c-style-for-loops.md>.
Eh, as long as a feature wasn’t removed for security or correctness reasons 
(which isn’t the case with SE-0007), I don’t see a problem with one proposal 
enabling functionality that was removed by another. It’s not like we said 
C-style for loops are evil or anything, just that they weren’t right for Swift. 
If it turns out that something which otherwise is right for Swift can be 
“abused” to get C-style for loop semantics, then those who voted against 
SE-0007 are free to try out this new syntax and see if that helps them. IMHO, 
anyway.

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

Reply via email to