On Sun, Oct 15, 2017 at 2:39 PM, Kevin Nattinger <sw...@nattinger.net> wrote:
> […] > 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. > What's your basis for saying that `elementsEqual` requires orders of iteration that "convey a meaning"? It merely answers the question of whether iterating over `a` is substitutable for iterating over `b`, a question applicable to instances of any type which offers iterated access.
_______________________________________________ swift-evolution mailing list swift-evolution@swift.org https://lists.swift.org/mailman/listinfo/swift-evolution