on Mon May 09 2016, Nate Cook <natecook-AT-gmail.com> wrote:

> Yet another alternative would be to drop Set and Dictionary down a
> level to a FiniteSequence protocol in between Sequence and
> Collection. Basically none of the index-based collection APIs
> (i.e. everything except `count` and `isEmpty`) make sense on sets and
> dictionaries. 

Strongly disagreed.  Any read-only operation that makes sense on a
bidirectional collection makes sense on these data structures.

> index(where:) was marginally useful with dictionaries, but now that
> Sequence is getting first(where:), née find(...), even that isn't
> necessary.

   s.remove(at: s.index(where: { $0 < 1 }))

-- 
-Dave
_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to