There’s a great discussion going on here, and I don’t mean to distract. But I 
want to ask: to get an infinite sequence using the Swift standard library, 
you’re going to have to create one yourself, say using the new `sequence()` 
functions? There’s nothing built in that is already infinite, so people will 
know what they are creating, that’s the explicit step, and there’s no need to 
have safety to infinitely loop over something. And if someone accidentally 
creates an unwanted infinite loop, that’s a fix in the creation of the 
sequence, not in its looping.

Patrick

> On 23 Jun 2016, at 11:12 AM, Matthew Johnson via swift-evolution 
> <[email protected]> wrote:
> 
> Sure, it’s not wrong in the sense that sometimes an infinite loop is valid.  
> But I think it would almost always be wrong (an accident) in practice.  If 
> you really want to loop over an infinite sequence maybe it’s a good thing to 
> require you to do that explicitly.

_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to