> On Oct 17, 2017, at 11:47 AM, Michael Ilseman via swift-evolution 
> <swift-evolution@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(a) //True
        [1,2,3,4,5].elementsEqual(b) //False… I guess they weren’t actually 
substitutable after all


Thanks,
Jon
_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to