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

2016-03-19 Thread Patrick Pijnappel via swift-evolution
Proposal pull request: #213 Implementation pull request: #1702 Original pitch thread: [Proposal] Change guarantee for GeneratorType.next() to always return nil past end

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

2016-03-19 Thread Erica Sadun via swift-evolution
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

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

2016-03-19 Thread Patrick Pijnappel via swift-evolution
Post-nil behavior being relevant is somewhat rare either way, but a comparison: *Current – post-nil unspecified* – Responsibility of the caller, needs to be aware of the API contract and needs to track a bool and branch when relying on post-nil. – Standard library currently has 3 occurrences of

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

2016-03-18 Thread Brent Royal-Gordon via swift-evolution
> Current – post-nil unspecified > – Responsibility of the caller, needs to be aware of the API contract and > needs to track a bool and branch when relying on post-nil. > – Standard library currently has 3 occurrences of this being necessary. I got curious and decided to try to locate these. I