Print

Print


On Fri, 19 Nov 2010 08:21:35 -0500, Bruce D'Arcus wrote

> 
> But ...
> 
> > Its all about precision:
> > 2000 is not before or after 2000-10
> > 2000-10 is not before or after 2000-10-12
> > 2000-24 would, similarly, not be before or after 2000-10-12.
> > 2000-24 would also not be before or after 2000-10-11
> 
> Yes, but in a bibliography, you can mix those dates (an author with
> three cited items: a book with a year, and two journal articles: one
> of them with a month cover date, and the other with a season cover
> date), and you need to sort them. So saying something is "not before
> or after" isn't practical.

Hugh? No No. That's how one defines a sort.
I'm pointing out how one compares items of different precision here.. In my
date class which I use in my engine I have all kinds of precision down to
seconds and in the other direction decade (e.g. 1950s) and century. The year
1852, for example, belongs to the 1850s and also to the 19th century.

1852 is not before or after the 19th century
1852 is not before or after the 1950s

1853 is not before or after the 19th century
1853 is not before or after the 1950s

but

1852 < (is before) 1853

in C++ with a class called, for example, xDATE

  friend int operator <  (const xDATE &dt1, const xDATE &dt2);
  friend int operator <= (const xDATE &dt1, const xDATE &dt2);
  friend int operator >  (const xDATE &dt1, const xDATE &dt2);
  friend int operator >= (const xDATE &dt1, const xDATE &dt2);
  friend int operator == (const xDATE &dt1, const xDATE &dt2);
  friend int operator != (const xDATE &dt1, const xDATE &dt2);
  
from which a simple sort can be derived.

My implementation currently does not have quarter or seasons but once we
develop a standard for encoding them I'd naturally extend things..

For precision--- in my implementation--- I think I'd probably take a pragmatic
approach and align all the types as equivalent precisions given the feeling
that they tend to be used in vaguer manners than the definition sets. This
would let me handle them as quarters with some fuzziness.. But.. I have to
give it some more thought.


--

Edward C. Zimmermann, NONMONOTONIC LAB
Basis Systeme netzwerk, Munich Ges. des buergerl. Rechts
Office Leo (R&D):
  Leopoldstrasse 53-55, D-80802 Munich,
  Federal Republic of Germany
http://www.nonmonotonic.net
Umsatz-St-ID: DE130492967