[swift-evolution] [Proposal] Change guarantee for GeneratorType.next() to always return nil past end

Patrick Pijnappel patrickpijnappel at gmail.com
Wed Mar 16 08:19:13 CDT 2016


Proposal: https://github.com/apple/swift-evolution/pull/213

On Wed, Mar 9, 2016 at 1:29 PM, Kevin Ballard via swift-evolution <
swift-evolution at swift.org> wrote:

> One minor change to what I've been proposing: Instead of merely saying
> that it's implementation-defined, we should expressly say that invoking
> next() after it has previously returned nil may return nil or it may return
> an implementation-defined value, but it should not fatalError() (unless
> some other GeneratorType requirement has been violated). Which is to say,
> after a GeneratorType has returned nil from next(), it should always be
> safe to invoke next() again, it's just up to the particular implementation
> to determine what value I get by doing that.
>
> -Kevin Ballard
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160317/e015c482/attachment.html>


More information about the swift-evolution mailing list