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,2e71cf22768a124d X-Google-Attributes: gid103376,public X-Google-Thread: 1014db,9d58048b8113c00f X-Google-Attributes: gid1014db,public From: Richard Riehle Subject: Re: next "big" language?? (disagree) Date: 1996/06/07 Message-ID: #1/1 X-Deja-AN: 159118387 references: <4p3nqb$k4a@btmpjg.god.bel.alcatel.be> <4p3nto$k4a@btmpjg.god.bel.alcatel.be> to: Ian Ward content-type: TEXT/PLAIN; charset=US-ASCII organization: National University, San Diego mime-version: 1.0 newsgroups: comp.lang.ada,comp.lang.c Date: 1996-06-07T00:00:00+00:00 List-Id: On Thu, 6 Jun 1996, Richard Riehle wrote: To Anyone who might have noticed: I guess I should desk-check my code more carefully. The example shown below would generate a compile-time error due to a type mismatch. Better to have defined the index type as a subtype of Positive, or even Integer than a a distinct type. This points out one of the benefits of Ada: when sloppy coders, such as I seem to be, make this kind of error, it is easily detected and rejected by the compiler. Sorry for the coding error. Mea culpa. The offending code follows: Richard Riehle > type T1 is range 1..10; -- change the preceding to subtype T1 is Positive range 1..10; > type Vector is array(Positive range <>) of Float; > > Then we declare a variable of type Vector: > > Float_Set : Vector(T1'First..T1'Last); > > Some algorithm, elsewhere in the code can be written as: > > for I in Float_Set'Range loop ... end loop; > [snip, snip ] the rest of the message deleted