On Tue, Mar 5, 2013 at 8:53 AM, Jason Orendorff <jason.orendo...@gmail.com> wrote: > On Tue, Mar 5, 2013 at 8:15 AM, David Bruant <bruan...@gmail.com> wrote: >> I agree on the need but forsee problems with parametrized equivalence >> operator [1][2] like "which comparator should be used for the union of 2 >> sets with different comparators?" > > I vote TypeError. If I really do intend to mix two incompatible Sets, I can > go ahead and write it longhand, which is what, 3 lines? 2 with > set.addAll(iterable).
Alternately, just use the comparator of the first set (the one you're calling the method on). If we add generic (non-method) forms, then actually take the first one. I'm loathe to throw a TypeError when it's difficult (impossible?) to check two sets for equivalent comparators, so you'd have to wrap every Set mixing operation in a try/catch if you can't be 100% certain that they use the same comparators. ~TJ _______________________________________________ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss