[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: () eq () vs () = ()

Subject: Re: () eq () vs () = ()
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Fri, 30 Sep 2011 07:02:44 -0400
Re:  () eq () vs () = ()
At 2011-09-30 11:48 +0100, Andrew Welch wrote:
On 30 September 2011 10:54, Stefan Krause <stf@xxxxxxxx> wrote:
> To make the confusion complete, deep-equals((),()) returns true(), which is IMHO the most expected behavior.


heh so

() = () returns false

deep-equals((),()) returns true

That's interesting, I'm guessing it has to be a 'just because'
reason... unless its because, ahem, deep down everything is equal  :)

:{)}


Fwiw, it applies to the other comparison operators too, eg () > ()
returns false, () ge () returns ().

Ummmmm ... if either operand of *any* symbol comparison is the empty set the result returned is false() because the result is initialized to false() before determining any of the individual comparisons. It then finds there are none, so there is nothing to do.


And XPath 2 3.5.1(2) dictates very similarly that if either operand is the empty sequence the result returned is the empty sequence without doing any other work. And if you convert the empty sequence to a Boolean you end up with false() as well.

And the very first bullet of Functions 15.3.1 for deep-equal() reads "If the two sequences are both empty, the function returns true."

Does all that qualify as "just because"? At least it is well defined. As a user I like the fact that such behaviours are well-defined ... I'm sure developers must appreciate that as well.

I'm trying to understand where your frustration with the specification or the behaviours lies.

Thanks!

. . . . . . . . . Ken

--
Contact us for world-wide XML consulting and instructor-led training
Crane Softwrights Ltd.            http://www.CraneSoftwrights.com/s/
G. Ken Holman                   mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Google+ profile: https://plus.google.com/116832879756988317389/about
Legal business disclaimers:    http://www.CraneSoftwrights.com/legal

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.