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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,4751d44ff54a2c2c X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-08-11 08:50:02 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!kibo.news.demon.net!news.demon.co.uk!demon!pogner.demon.co.uk!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: 64-bit integers in Ada Date: 11 Aug 2002 16:32:44 +0100 Organization: Pushface Sender: simon@smaug Message-ID: References: <3CE3978F.6070704@gmx.spam.egg.sausage.and.spam.net> <3D46DC69.7C291297@adaworks.com> <5ee5b646.0207301613.5b59616c@posting.google.com> <5ee5b646.0208030424.39703482@posting.google.com> <3D4C2805.62563584@adaworks.com> <5ee5b646.0208040607.ebb6909@posting.google.com> <3D4DE2C2.8A7674E6@adaworks.com> NNTP-Posting-Host: pogner.demon.co.uk X-NNTP-Posting-Host: pogner.demon.co.uk:62.49.19.209 X-Trace: news.demon.co.uk 1029080944 nnrp-12:19713 NO-IDENT pogner.demon.co.uk:62.49.19.209 X-Complaints-To: abuse@demon.net User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Xref: archiver1.google.com comp.lang.ada:27929 Date: 2002-08-11T16:32:44+01:00 List-Id: Richard Riehle writes: > Robert Dewar wrote: > > > First. I trust we all agree that new Ada code should > > almost NEVER EVER use type Integer, except as the > > index of the String type. > > Robert, > > We are in full agreement on all of the points you made. > > The only two uses of predefined type Integer are its > requirement in the predefined String, and for occasional > pedagogic purposes, and the latter use often leads to > more trouble than it is worth. Well, I think that when you are writing libraries you may find that Integer, Natural and Positive have their uses. For example, package Tables is type Item_Array is array (Positive range <>) of Items.Item_Container; type Value_Array is array (Positive range <>) of Values.Value_Container; type Table (Number_Of_Buckets : Positive) is record Items : Item_Array (1 .. Number_Of_Buckets); Values : Value_Array (1 .. Number_Of_Buckets); Size : Natural := 0; end record; .. it seems pointless to force the user to provide yet another parameter to specify the type for Number_Of_Buckets. I note also that GNAT.Dynamic_Tables has generic type Table_Component_Type is private; type Table_Index_Type is range <>; Table_Low_Bound : Table_Index_Type; Table_Initial : Positive; Table_Increment : Natural; package GNAT.Dynamic_Tables is