RE: [F&O] 15.3 Aggregate Functions

> You are making assertions here which are not self-evident. There are
> different design options here, which have different pros and cons, and
> the
> optimum solution isn't obvious at all.
> 
> One of the arguments is that when static typing is in force, a type
> signature of xs:double+ would not only require the dynamic type to be
> one-or-more numbers, it would also require the static type to be
> one-or-more. So users of static typing systems (for whom, I must say, I
> have
> little sympathy) would have to write min(one-or-more(book/@price)).

Because they are users of such systems, they will have to use min() in
this way.

But it is still exact and much better than obtaining false results.

Consider having N sequences and obtaining the sum of their maximums.

In the case when:
  
  1. every sequence is empty, 

  2. and max(()) = ()

  3. and sum(()) = 0


the result -- the sum of the maximums of these N sequences -- will be 0.

This is a false result, since none of the sequences has an item with value
0, none of them has an item with maximum value.

In particular, the sum of maximums of these sequences will be greater than
the sum of maximums of N nonempty sequences with negative elements, etc...

Based on such false result other unfounded conclusions/results may be
obtained.

No error will be raised and the falseness of this result may never be
noticed by the users. 

Provided a design option offers more convenience *and* it does not allow
false results to be produced, this is acceptable.

However, we should not go for a design option that allows obtaining of
false results.


Dimitre Novatchev.

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

Received on Sunday, 23 November 2003 01:35:19 UTC