From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.ada Subject: Re: What is the history behind Natural'First = 0 ? Date: Fri, 01 May 2020 12:03:14 -0700 Organization: None to speak of Message-ID: <874ksz4gwd.fsf@nosuchdomain.example.com> References: <9f0215ca-2760-47cf-a7cb-50184892e1d0@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: reader02.eternal-september.org; posting-host="3a8562cb4f6a88758e42aeb600e70f1e"; logging-data="792"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18AtDDnwnLM34EeyMC3sZY0" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) Cancel-Lock: sha1:tIh44Z99A0CL8Z2ARvnw9fPJPuU= sha1:aldZ4r7daNGZwRoaQjUyk/s2WxI= Xref: reader01.eternal-september.org comp.lang.ada:58546 Date: 2020-05-01T12:03:14-07:00 List-Id: "J-P. Rosen" writes: > Le 01/05/2020 à 06:51, reinert a écrit : >> Why Natural'First = 0 ? >> > Because that's the way it is ;-) > > Anyway, type Integer is not the mathematical notion of (infinite) > integers, and more generaly computer types are only reduced abstractions > of mathematical notions. > > There is a need for a subtype of type Integer with lower bound 0, and > another one for lower bound 1. The names have been chosen by Ichbiah > following usual practice, they could have been anything else. When I was learning about sets of numbers in elementary school, we were told that the natural numbers are positive integers and the whole numbers are non-negative integers (including 0). Based on that, if I had been designing the language I probably would have used the name Natural for 1..Integer'Last and Whole for 0..Integer'Last. On the other hand, the word "Whole" sounds like "Hole" (at least in my version of non-accented American English), so I can see that being awkward in some contexts. 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. It's ultimately arbitrary. I found the use of Natural in Ada slightly jarring the first time I encountered it, but I have no complaints. And the name Positive seems entirely reasonable. -- 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 */