[swift-evolution] C-style For Loops

Per Melin p at greendale.se
Sun Dec 6 12:08:43 CST 2015


On Sun, Dec 6, 2015 at 5:59 PM, Erica Sadun via swift-evolution <
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20151206/5413cf2e/attachment.html>


More information about the swift-evolution mailing list