[swift-evolution] Change `repeat` to loop indefinitely if no while clause is present

Xiaodi Wu xiaodi.wu at gmail.com
Tue May 10 19:03:57 CDT 2016


Right. I'd like to echo Erica, though, and add my thanks to Nicholas for
bringing it up. It certainly prompted a discussion, and it was a refreshing
idea indeed.
On Tue, May 10, 2016 at 18:19 Cole Campbell <cole.m.campbell at icloud.com>
wrote:

>
> That’s fair enough. :)
>>
>> But surely you’ll admit that if
>>
>> repeat N {
>>
>> }
>>
>> was valid, then repeat { } follows as the logical repeat indefinitely
>> syntax, no?
>>
>
> No! Not at all! As I wrote above, it could mean repeat once. It currently
> means repeat until the condition that follows, and if that condition is
> optional you only find out after you read everything in the loop. So, IMO,
> it does not follow at all!
>
>
> I agree, it doesn't follow that if repeat N { } exists then somehow repeat
> without an argument means 'forever'. In English, 'repeat' without anything
> to indicate how many time means 'repeat once'.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160511/fdf54e43/attachment.html>


More information about the swift-evolution mailing list