on Wed Jun 22 2016, David Waite <david-AT-alkaline-solutions.com> wrote:

>> On Jun 22, 2016, at 2:57 PM, Dave Abrahams via swift-evolution 
>> <[email protected]> wrote:
>> 
>> <Ahem> “Iterators,” please.
>
> That makes me happy - for some reason I thought it was still GeneratorProtocol
>
>>> destructively, but such Generators would not conform to the needs of
>>> Sequence. As such, the most significant impact would be the inability
>>> to use such Generators in a for..in loop, 
>> 
>> Trying to evaluate this statement, it's clear we're missing lots of
>> detail here:
>> 
>> * Would you remove Sequence?
>> * If so, what Protocol would embody “for...in-able?”
> No, I would just remove the allowance in the documentation and API
> design for a destructive/consuming iteration. Sequence would be the
> interface to getting access to repeatable iteration, without the need
> for meeting the other requirements for Collection.

That would be wrong unless there exist substantial examples of a
multipass Sequence that *can't* meet the other requirements of
Collection without loss of efficiency.  And since I can write an adaptor
that turns any multipass sequence into a Collection, I think it's
trivial to prove that no such examples exist.

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

Reply via email to