[F&O] 15.1.9 fn:distinct-values

There are two issues here.

Issue 1.
========

The "Summary" says:

"Summary: Returns the sequence that results from removing from $arg all
but one of a set of values that are eq to one other. Values that cannot be
compared, i.e. the eq operator is not defined for their types, are
considered to be distinct."

According to this summary, the example given:

"15.1.9.1 Examples
fn:distinct-values(1, 2.0, 3, 2) might return (1, 3, 2.0)."

is wrong.

If we remove from (1, 2.0, 3, 2) all but one of a set of values that are
eq to one other -- e.g. remove 2, then what we'll get will be:

     (1, 2.0, 3)

The Summary misses the very important fact that the unique values are
returned in any order -- so it is not just removing...

This fact is mentioned just at the end of the section:


"Which value of a set of values that compare equal is returned, along with
its original type annotation, is ·implementation dependent·. Note that
xs:dateTime, xs:date or xs:time values can compare equal even if their
timezones are different. The order in which the sequence of values is
returned is ·implementation dependent·."

The reading and understanding of this paragraph is made difficult, because
the meaning of the second sentence has nothing to do with the meaning of
the first and third sentence.

The second sentence has to be moved to its proper paragraph.


Issue 2.
=======

The example 

"15.1.9.1 Examples
fn:distinct-values(1, 2.0, 3, 2) might return (1, 3, 2.0)."

is also incorrect, because three arguments and not just one are passed to
the function. In this case the function should throw an error.

A correct example might be:

fn:distinct-values( (1, 2.0, 3, 2) ) might return (1, 3, 2.0).


Dimitre Novatchev

__________________________________
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/

Received on Saturday, 22 November 2003 08:25:53 UTC