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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,a3ca574fc2007430 X-Google-Attributes: gid103376,public X-Google-Thread: 115aec,f41f1f25333fa601 X-Google-Attributes: gid115aec,public From: geert@fozzie.sun3.iaf.nl (Geert Bosch) Subject: Re: Ada and Automotive Industry Date: 1996/11/16 Message-ID: <56l4tf$6ef@fozzie.sun3.iaf.nl>#1/1 X-Deja-AN: 196982079 references: <3280DA96.15FB@hso.link.com> <1996Nov6.210957.3070@ole.cdac.com> <1996Nov8.183051.21638@ole.cdac.com> followup-to: comp.lang.ada organization: La Calandre Infortunee newsgroups: comp.lang.ada,comp.realtime Date: 1996-11-16T00:00:00+00:00 List-Id: Robert Dewar (dewar@merv.cs.nyu.edu) wrote: "Another example in Ada is the x : array (1 .. 10) of ... which again defaults to type Integer. Given that we generally accept that it is a bad idea for programs to use the built in Integer type, it is quite inappropriate to have this kind of default. " Although in practice I almost never use an Integer literal for specifying the upperbound of a range, I don't see any reason why it is "bad" in general to use the predefined Integer type as index type. Especially for array indices and string lengths, I find using the predefined type very useful. It might be that people on a 16-bit machine with 16-bit integers might not be able to handle strings longer than 65536 characters, or arrays with more than 2**16 elements. But they won't expect to be able to do so, so what's the problem? Using 32-bit array indices would not be efficient on that type of machine. Also all standard packages use Integer subtypes so a Bounded_String is always a type using the default type Integer as range? Is this a risk? Although I certainly can appreciate Ada's strong typing, taking it to the extreme causes code type casting all over the place which *really* makes strong typing useless. -- E-Mail: geert@sun3.iaf.nl