[Bug 2535] One empty sequence is deep-equal to another, but they are not =

http://www.w3.org/Bugs/Public/show_bug.cgi?id=2535





------- Additional Comments From mike@saxonica.com  2005-11-18 21:30 -------
The general rule for deep-equal() is that two sequences A and B are deep-equal
if count(A) = count(B) and every $n in (1 to count(A)) satisfies
deep-equal(A[$n], B[$n]).

A consequence of this is that deep-equal((), ()) is true. This is because in
mathematical logic (every x in X satisfies C) is always true when X is empty.

deep-equal() and = adopt fundamentally different ways of comparing two
sequences, both of which are useful. It should not be suprising that they give
different results for the empty sequence, since they also give different results
for most other sequences.

Michael Kay
personal response

Received on Friday, 18 November 2005 21:30:17 UTC