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

Tyler Cloutier cloutiertyler at aol.com
Tue May 10 15:39:18 CDT 2016


> On May 10, 2016, at 1:34 PM, Sean Heber <sean at fifthace.com> wrote:
> 
>> On May 10, 2016, at 3:30 PM, Tyler Cloutier via swift-evolution <swift-evolution at swift.org> wrote:
>> 
>> Secondly it’s a very simple way of introducing new programmers to loops. It’s IMHO more clear to a new programmer that repeat will just repeat indefinitely vs while true.
> 
> This point seems strange to me - why teach a new programmer about loops by first showing them a looping construct they should probably never use in actual practice until they really know what they’re doing?

That is a fair point, but it’s probably a good way of illustrating other ways of exiting a loop, without having the complication of a while condition.

> 
> l8r
> Sean
> 



More information about the swift-evolution mailing list