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-Thread: 103376,7b6305d0d57a9f34 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.50.169 with SMTP id d9mr3592118pbo.0.1320236041216; Wed, 02 Nov 2011 05:14:01 -0700 (PDT) Path: p6ni62530pbn.0!nntp.google.com!news1.google.com!newsfeed2.dallas1.level3.net!news.level3.com!bloom-beacon.mit.edu!newsswitch.lcs.mit.edu!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Normalizing array indices Date: Wed, 02 Nov 2011 08:14:00 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 X-Trace: pcls6.std.com 1320236040 13666 192.74.137.71 (2 Nov 2011 12:14:00 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Wed, 2 Nov 2011 12:14:00 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:IXRvtt7OjDG5u4eBNqLggBJFHHI= Xref: news1.google.com comp.lang.ada:18787 Content-Type: text/plain; charset=us-ascii Date: 2011-11-02T08:14:00-04:00 List-Id: Simon Wright writes: > I've had more surprises with > > type Arr is array (Integer range <>) of Float; > A : Arr := (1.0, 2.0, 3.0); > > where A'First is Integer'First (on GNAT), ie -2**31. Yes. It's usually a bad idea to declare an unconstrained array (T range <>) where T'First = T'Base'First, because then empty arrays don't work well. E.g., "array (Enum_Type) ..." is OK, but "array (Enum_Type range <>) ..." is probably wrong. - Bob