comp.lang.ada
 help / color / mirror / Atom feed
From: lindsay@comp.vuw.ac.nz (Lindsay Groves)
Subject: Re: of a year, years, and half a year (was Re: (none))
Date: 7 Sep 89 04:38:01 GMT	[thread overview]
Message-ID: <1989Sep7.043801.16887@comp.vuw.ac.nz> (raw)
In-Reply-To: 13711@grebyn.com

Newsgroups: comp.lang.ada
Subject: Re: of a year, years, and half a year (was Re: (none))
Summary: 
Expires: 
References: <8909022213.AA06286@ajpo.sei.cmu.edu> <2007@munnari.oz.au> <13711@grebyn.com>
Sender: 
Reply-To: lindsay@taputeranga.comp.vuw.ac.nz (Lindsay Groves)
Followup-To: 
Distribution: 
Organization: Dept of Comp Sci, Victoria University of Wellington, NZ.
Keywords: 

In article <13711@grebyn.com> karl@grebyn.com (Karl Nyberg) writes:
> ...
> ...                                 I'm surprised that C.hackers (of all
>people) wouldn't start with 0-based counting (like their poor arrays, K&R,
>1.6, p 20), making the current millenium from 1000 .. 1999, and the current
>decade of the 1980s from 1980 .. 1989.  Then the year 1990 would indeed MARK
>the end of the current decade (known as the eighties, as all the years are
>of the form 198[0-9]) and begin the first year of the nineties.
>
>I can't fathom what DECADE we would call the years 1981 - 1990 (inclusive),
>but there's probably some name for it...

Why not call it the 199th decade?  This terminology is clearly superior, 
since it doesn't suffer from the ambiguity inherent in "the eighties",
"the nineties" etc -- viz. that they don't specify the century to which 
they belong, you have to somehow infer what century the speaker/write is
referring to, which may or may not be the century in which they made the
statement.

>Of course, all this wonderful analysis gets blown away by the fact that the
>year 1 BC is followed immediately by the year 1 AD (BCE, or whatever your
>religious conviction allows you to say).  Suffer the discontinuities of this
>concept of time (running from negative infinity to -1, followed by 1 to plus
>infinity, again depending upon your religions conviction), make the first
>decade of the current era have only 9 years, change the common meaning of
>things like "the eighties", the "nineteenth century", there are dozens of
>options.  And throw in the missing months during the calendar change, leap
>years, leap seconds, add various timezones for the folks in Australia, ...
>
>But I digress.  Maybe somebody can make this another Ada 9X language issue.
>I just love having more language issues for 9X.  It'll give me something to
>do this winter and spring!  :-)

It seems to me that the issue for Ada 9X (or any other language whose
designers care to address such issues) is how you then define YEAR as
a data type, which should clearly be available in a standard predefined
package.  First, we need an unbounded integer type.  Then we need to define
YEAR as a subtype of this type, which does not include 0.  This could be
done either by taking the union of two semibounded integer types
(range -INFINITY .. -1 and range 1 .. INFINITY) or by some form of type
subtraction (e.g. (range -INFINITY .. INFINITY) - 0).  Since Ada does not 
currently have either type union or type subtraction, it will be necessary
to consider these features carefully to determine how general they need to
be, devise formal semantics, consider implementation problems etc, so the
alternatives can be evaluated and a final proposal decided upon.

One issue that needs to be addressed is how to define operators on such types.
Should SUCC(-1) give 1, or should this raise an exception?  Perhaps any
program evaluating this expression should cause a picture of a bright star to
be displayed on the user's terminal!

I think I'll leave the rest of the issues of be debated by the appropriate
bodies and get back to some work.

	Lindsay

      parent reply	other threads:[~1989-09-07  4:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1989-09-02 22:13 (none) cdonalds
1989-09-04  1:43 ` (none) Richard O'Keefe
1989-09-04 13:28   ` of a year, years, and half a year (was Re: (none)) Karl Nyberg
1989-09-05  3:35     ` Richard O'Keefe
1989-09-05 13:50       ` George Mitchell
1989-09-06  1:14       ` Norman Diamond
1989-09-06 15:03         ` C.E. Thompson
1989-09-07 11:40         ` Conor O'Neill
1989-09-07  4:38     ` Lindsay Groves [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox