[Draft] Rename Sequence.elementsEqual

From: Kevin Nattinger <swift@nattinger.net>
Subject: Re: [swift-evolution] [Draft] Rename Sequence.elementsEqual
Date: October 14, 2017 at 12:52:34 AM PDT
To: Xiaodi Wu <xiaodi.wu@gmail.com>

Regardless of the specific type of ordering, lexicographicallyEquals says to me that the objects should be sorted into lexicographical order and compared. Precisely the opposite of the proposal.

That is an interesting interpretation. I suppose anyone has the right to interpret anything in any way they please, but this seems a uniquely idiosyncratic interpretation. The total ordering is over the set of all sequences, and the comparison is between two sequences--note that the function name uses the singular ("equals") and makes no reference to the lexicography or ordering of elements. Likewise, dictionaries don't sort "hello" and "world" by comparing "ehllo" and "dlorw”.

Others have expressed the same interpretation as well. It’s most certainly not “uniquely idiosyncratic.”
As for the rest of this, perhaps it’s the late hour, but I don’t see your point or the relevance to my argument. I didn’t say anything about sorting individual elements, just that elements would be reordered so that both sequences would be in lexicographical order. Comparing unordered collections according to their (nonexistent) order is nonsensical, so the only useful way to compare them would be to impose an external order.


Begin forwarded message: