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

Cole Campbell cole.m.campbell at icloud.com
Tue May 10 18:19:44 CDT 2016


>> 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/20160510/c7d5f653/attachment.html>


More information about the swift-evolution mailing list