[swift-evolution] [Draft] Rename Sequence.elementsEqual
jhull at gbis.com
Tue Oct 17 14:00:21 CDT 2017
> On Oct 17, 2017, at 11:47 AM, Michael Ilseman via swift-evolution <swift-evolution at swift.org> wrote:
> `==` conveys substitutability of the two Sequences. This does not necessarily entail anything about their elements, how those elements are ordered, etc., it just means two Sequences are substitutable. `elementsEqual` means that the two Sequences produce substitutable elements. These are different concepts and both are independently useful.
I agree that ‘==‘ conveys substitutability. Here is the issue:
let a = Set([1,2,3,4,5])
let b = Set([5,4,3,2,1])
a == b //True, they are substitutable
[1,2,3,4,5].elementsEqual(b) //False… I guess they weren’t actually substitutable after all
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution