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 Path: g2news2.google.com!news2.google.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!nx02.iad01.newshosting.com!newshosting.com!newspeer.monmouth.com!newsswitch.lcs.mit.edu!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: (Num_Types.Mod_4 range 1..8) ------->why not (1..8)? Date: Mon, 18 May 2009 15:49:02 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <0571282b-0ab8-4eee-941f-e9369f5b4518@x6g2000vbg.googlegroups.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls6.std.com 1242676142 26865 192.74.137.71 (18 May 2009 19:49:02 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Mon, 18 May 2009 19:49:02 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:cI5J+BLlGrGR5bdStIvk0chWJkM= Xref: g2news2.google.com comp.lang.ada:5907 Date: 2009-05-18T15:49:02-04:00 List-Id: convergence82 writes: > type Data_Array is array (Num_Types.Mod_4 range 1..8) of > Num_Types.Mod_8; > > what's the difference between this and: > > type Data_Array is array (1..8) of Num_Types.Mod_8; > > ? The index types are different. The second one is a short-hand for: type Data_Array is array (Integer range 1..8) of Num_Types.Mod_8; It's usually (not always) a bad idea to index an array by a modular type. Use a signed integer type. I think it's poor style to say "1..8" here; I'd spell it out as "Integer range 1..8" or "Positive range 1..8". Better yet, declare a new signed integer type: type Index is range 1..8; type Data_Array is array (Index) of Num_Types.Mod_8; - Bob