You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While Rebol2 did not appear to try to compare object values field-by-field for equality, there exists code in R3-Alpha to do so (and apparently Red has it too):
>> x: make object! [a: 1 b: 2]
>> y: make object! [a: 1 b: 2]
>> x = y
== true
>> x: make object! [a: 1 b: 2]
>> y: make object! [a: 10 b: 20]
>> x = y
== false
However, neither R3-Alpha nor Red will do a check which takes order into account:
>> x: make object! [a: 1 b: 2]
>> y: make object! [b: 2 a: 1]
>> x = y
== false
If order is a distinct point of semantics in object equality, then that is a major issue. Attempts to hide the order (e.g. not to have PICK OBJ 2) may be misguided.
Note that JavaScript punts entirely on the idea of comparing objects field-by-field, forcing utility authors to implement an _.isEqual() function:
While Rebol2 did not appear to try to compare object values field-by-field for equality, there exists code in R3-Alpha to do so (and apparently Red has it too):
However, neither R3-Alpha nor Red will do a check which takes order into account:
If order is a distinct point of semantics in object equality, then that is a major issue. Attempts to hide the order (e.g. not to have PICK OBJ 2) may be misguided.
Note that JavaScript punts entirely on the idea of comparing objects field-by-field, forcing utility authors to implement an _.isEqual() function:
https://stackoverflow.com/questions/201183/how-to-determine-equality-for-two-javascript-objects
The text was updated successfully, but these errors were encountered: