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
At meeting 024 where PR #320 was accepted, there remained an open question of how to deal with errors.
On the one hand, in order for fn:deep-equal to be most easily used as a comparison function in the many contexts where a comparison function is required, it would be best if it simply returned false() rather than raising an error when incomparably items are encountered.
On the other hand, making "return false()" the default will mean that it is possible to construct items that are not equal to themselves, which will certainly violate the expectations of some users.
This conflict needs to be resolved somehow.
The text was updated successfully, but these errors were encountered:
If we allow fn:deep-equal to compare function items, that would change the behavior of the function and lose backwards-compatibility. Can we do that at all? I guess it could be viable, as the old result was an error, and we are basically making the function more powerful. What do others think?
If we can do it, my preference would be to drop false-on-error and always return true/false once we have resolved in #333 how we want to compare function items.
(a) drop the error condition and the false-on-error option
(b) for comparing function items, adopt the rules in F&O §1.8.4, which basically say that the result is false unless the processor is "able to determine" that the two functions always have the same effect, which probably means in practice that a processor will only return true if the two functions are internally implemented by pointers to the same object in memory. The best thing about this rule is that deep-equal($x, $x) is allowed to return true without even looking first to see whether $x contains any functions.
A change whereby something that used to throw an error now returns a non-error result is not generally considered to be an incompatibility.
At meeting 024 where PR #320 was accepted, there remained an open question of how to deal with errors.
On the one hand, in order for
fn:deep-equal
to be most easily used as a comparison function in the many contexts where a comparison function is required, it would be best if it simply returnedfalse()
rather than raising an error when incomparably items are encountered.On the other hand, making "return false()" the default will mean that it is possible to construct items that are not equal to themselves, which will certainly violate the expectations of some users.
This conflict needs to be resolved somehow.
The text was updated successfully, but these errors were encountered: