[swift-evolution] [Draft] Change IteratorType post-nil guarantee

Patrick Pijnappel patrickpijnappel at gmail.com
Fri Mar 18 12:58:33 CDT 2016


>
> What about Kevin's Rust-like approach (the fuse) as an alternative
> considered?
> He suggested that instead of changing the guarantees and behavior of the
> existing
> GeneratorType, that Swift introduce a new FuseGenerator adaptor that could
> include
> extra state ensuring that it could safely return nil  indefinitely as Rust
> does


I'll include a section about that!

On Sat, Mar 19, 2016 at 1:16 AM, Erica Sadun <erica at ericasadun.com> wrote:

> What about Kevin's Rust-like approach (the fuse) as an alternative
> considered?
> He suggested that instead of changing the guarantees and behavior of the
> existing
> GeneratorType, that Swift introduce a new FuseGenerator adaptor that could
> include
> extra state ensuring that it could safely return nil  indefinitely as Rust
> does
>
> -- E
>
>
> On Mar 17, 2016, at 11:47 PM, Patrick Pijnappel via swift-evolution <
> swift-evolution at swift.org> wrote:
>
> Proposal pull request: #213
> <https://github.com/apple/swift-evolution/pull/213>
> Implementation pull request: #1702
> <https://github.com/apple/swift/pull/1702>
> Original pitch thread: [Proposal] Change guarantee for
> GeneratorType.next() to always return nil past end
> <http://thread.gmane.org/gmane.comp.lang.swift.evolution/8519>
>
> Alternatives considered
>
>    - Require IteratorType to not crash but keep the return value up to
>    specific implementations. This allows them to use it for other behavior
>    e.g. repeating the sequence after nil is returned. This however
>    retains most of the problems of the original guaranteee described in this
>    proposal.
>
>
> _______________________________________________
> 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/20160319/59710474/attachment.html>


More information about the swift-evolution mailing list