Object.eq is ready for discussion

Jürg Lehni lists at scratchdisk.com
Tue Sep 7 04:05:21 PDT 2010


I would expect compare() to return either -1, 0 or 1...

On 7 Sep 2010, at 11:58, Asen Bozhilov wrote:

> Mark S. Miller:
>> http://wiki.ecmascript.org/doku.php?id=strawman:egal
>> [...]
>> Opinions?
> 
> How about:
> 
> Object.compare(x, y);
> 
> I think this is enough meaningful and solve the problem with third
> party naming collisions. I would like to see `compare' method with
> more than two arguments. For example If I want to compare three
> objects for equalities, I should be write:
> 
> Object.identity(x, y) && Object.identity(y, z)
> 
> Isn't good idea for comparing N arguments for equality? The code above
> would be rewritten as:
> 
> Object.identity(x, y, z)
> 
> I really miss the point, why the language API should be care about
> naming collisions with third party libraries? If tomorrow someone in
> JQuery or Prototype team makes a decision for augmentation of `Object'
> constructor, is it really matter for the designers of the language
> API?
> 
> Thanks in advance for your valuable answers.
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss



More information about the es-discuss mailing list