W3C home > Mailing lists > Public > public-qt-comments@w3.org > May 2003

Re: node equality: fn:node-equal()

From: Tobias Reif <tobiasreif@pinkjuice.com>
Date: Wed, 14 May 2003 09:54:10 +0200
Message-ID: <3EC1F622.6040306@pinkjuice.com>
To: Michael Rys <mrys@microsoft.com>
CC: public-qt-comments@w3.org

Michael Rys wrote:

> How do you define node equality?


Just as fn:deep-equal() already does, without recursing down the tree, I 
would think.

> The whole reason for fn:deep-equal() is to
> provide the most common from of node equality.


But if I want to test two nodes for equality, and they have five 
thousand children, then using fn:deep-equal() would do 5001 comparisons 
instead of one (where one comparison includes attributes etc).

> Any other form in my
> opinion should be written by the user him-/herself.


As I said, I could do it by testing various aspects of the pair, thus 
writing my:node-equal(), but I'd prefer to have it available in the 
language.

Comparing two nodes for equality is even more basic, general, and useful 
as is fn:deep-equal(). I could write a lot myself, but I also could 
design and implement the whole lang myself.

> Having a
> proliferation of equality functions in the spec seems not appropriate
> (as David C. pointed out).


I think something like a standard library could be a good idea (see 
David's posts): A small language with a sufficiently comprehensive 
library of utility functions (etc).

Tobi

-- 
http://www.pinkjuice.com/
Received on Wednesday, 14 May 2003 03:55:31 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 March 2012 18:14:24 GMT