W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > October to December 2002

Durations are not closed under addition

From: by way of <staschuk@telusplanet.net>
Date: Tue, 24 Dec 2002 11:28:49 -0700
Message-Id: <5.1.0.14.1.20021224112823.02a12400@localhost>
To: W3C XML Schema Comments list <www-xml-schema-comments@w3.org>




	Time durations are added by simply adding each of
	their fields, respectively, without overflow.
	               [_Part 2: Datatypes_, section E.2]

Consider "P1Y" + "-P1D".  Prior to the clarification of erratum
E2-23, we might think this results in "P1Y-1D", one day less than
a year.  However, now it is clear that durations are not closed
under addition.

Closure under addition is a useful enough property that I'd like
to see in 1.1 a duration-like type which has it.  The only
difference between the two types would be the admission of signs
on a component-by-component basis.  Such a type being defined, it
would seem most natural to reformulate the existing duration type
as a derivation-by-restriction of the new type; but I imagine
there are some backwards-compatibility issues to be considered.

(In the meantime, of course, implementations can use pairs of
durations, one positive and one negative, for arithmetic purposes.)

-- 
Steven Taschuk           |    w_w
staschuk@telusplanet.net | ,-= U
                          |  1 1    Moose 
Received on Tuesday, 24 December 2002 14:15:11 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Sunday, 6 December 2009 18:13:01 GMT