[swift-evolution] [Draft] Rename Sequence.elementsEqual

Kevin Nattinger swift at nattinger.net
Sun Oct 15 14:39:50 CDT 2017


> […]
> Swift's Sequence protocol does not require the order of iteration to "convey any meaning"; it doesn't even require it to be deterministic.
> 

And that’s EXACTLY why none of the functions on Sequence should rely on the order conveying meaning.  `ElementsEqual` (for example) DOES rely on the order of iteration conveying a meaning not required by the protocol, and renaming it `lexicographicallyEquals` does not change that fact. Either Sequence needs to require a meaningful order or `elementsEqual` should be moved to a protocol that does.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20171015/192d198b/attachment.html>


More information about the swift-evolution mailing list