From: Keith Thompson <Keith.S.Thompson+u@gmail.com>
Subject: Re: What is the history behind Natural'First = 0 ?
Date: Sun, 03 May 2020 13:08:37 -0700
Date: 2020-05-03T13:08:37-07:00 [thread overview]
Message-ID: <87o8r43hoa.fsf@nosuchdomain.example.com> (raw)
In-Reply-To: wccv9lf5od3.fsf@shell02.theworld.com
Robert A Duff <bobduff@TheWorld.com> writes:
> Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
>> Wikipedia says that some definitions have "natural numbers" starting
>> with 0, and others have them starting with 1 -- and the term "whole
>> numbers" is sometimes used to refer to the set of all integers.
>
> "The nice thing about standards is that there are so many to choose from."
>
> I seem to recall an early version of Ada (or Green) that said
> "subtype Natural is Integer range 1..Integer'Last;". I could
> be misremembering that, and (if true) I don't remember what the
> 0..Integer'Last one was called.
Yes, I remember that. I found a copy of the 1979 Preliminary Ada
Reference Manual from SIGPLAN Notices, June 1979 at
https://dl.acm.org/doi/pdf/10.1145/956650.956651
The section covering package STANDARD says:
subtype NATURAL is INTEGER range 1 .. INTEGER'LAST;
type STRING is array (NATURAL) of CHARACTER;
There was no predefined subtype starting at 0. I don't know just when
NATURAL was changed to start at 1 and POSITIVE was introduced.
(And I'm glad they decided to stop using ALL_CAPS for identifiers).
> Speaking of zero:
>
> Q: What caused the fall of the Roman Empire?
> A: They didn't know about zero, so they had no way to terminate
> the strings in their C programs. Har, har.
But it wasn't all that bad, since they only had 100 programs.
A Centurion walks into a bar. He holds up two fingers. "Five beers, please."
--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Working, but not speaking, for Philips Healthcare
void Void(void) { Void(); } /* The recursive call of the void */
next prev parent reply other threads:[~2020-05-03 20:08 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-01 4:51 What is the history behind Natural'First = 0 ? reinert
2020-05-01 7:52 ` J-P. Rosen
2020-05-01 8:38 ` AdaMagica
2020-05-01 10:24 ` J-P. Rosen
2020-05-01 19:03 ` Keith Thompson
2020-05-01 21:36 ` Robert A Duff
2020-05-03 20:08 ` Keith Thompson [this message]
2020-05-04 3:02 ` Keith Thompson
2020-05-04 8:50 ` Paul Rubin
2020-05-04 14:22 ` Dennis Lee Bieber
2020-05-01 10:13 ` Jeffrey R. Carter
2020-05-01 18:14 ` Optikos
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox