[swift-evolution] C-style For Loops
Erica Sadun
erica at ericasadun.com
Sun Dec 6 12:10:36 CST 2015
On Dec 6, 2015, at 11:08 AM, Per Melin <p at greendale.se> wrote:
>
> On Sun, Dec 6, 2015 at 5:59 PM, Erica Sadun via swift-evolution <swift-evolution at swift.org <mailto:swift-evolution at swift.org>> wrote:
> Another complaint regarded a loss of succinctness. Per Melin wrote:
>
> Another example from the same LinkedList class. It finds the right place to insert a new node:
>
> for next = head; next != nil && index > 0; prev = next, next = next!.next, --index { }
>
> Extreme? Probably, but I like it better than the same thing done in five lines of while loop.
>
>
> No worries, but for the record, I did absolutely not write that. I *quoted* that. I think that C-style 'for' is a horrible mess that should be killed with fire.
>
>
My apologies! -- E
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20151206/c06e5e38/attachment.html>
More information about the swift-evolution
mailing list