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,2ac407a2a34565a9 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.204.131.75 with SMTP id w11mr114643bks.0.1330535820519; Wed, 29 Feb 2012 09:17:00 -0800 (PST) Path: t13ni84140bkb.0!nntp.google.com!news2.google.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: Re: Array Help? Date: Wed, 29 Feb 2012 08:50:13 -0800 (PST) Organization: http://groups.google.com Message-ID: <17412419.40.1330534213855.JavaMail.geo-discussion-forums@vbva11> References: <10615783-d4a9-4cbd-8971-53ba1100d6a0@b18g2000vbz.googlegroups.com> NNTP-Posting-Host: 153.98.68.197 Mime-Version: 1.0 X-Trace: posting.google.com 1330535819 13604 127.0.0.1 (29 Feb 2012 17:16:59 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 29 Feb 2012 17:16:59 +0000 (UTC) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=153.98.68.197; posting-account=pcLQNgkAAAD9TrXkhkIgiY6-MDtJjIlC User-Agent: G2/1.0 Content-Type: text/plain; charset=ISO-8859-1 Date: 2012-02-29T08:50:13-08:00 List-Id: Robert A Duff wrote on comp.lang.ada: > You usually want arrays to start at 1, or sometimes 0 (assuming > the index type is a signed integer type, which is almost always > the case for unconstrained arrays). In Ada 2012, you can say: > > type Integer_Array is array (Positive range <>) of Integer > with Dynamic_Predicate => Integer_Array'First = 1; > > or: > > type Integer_Array is array (Natural range <>) of Integer > with Dynamic_Predicate => Integer_Array'First = 0; > > Now 'Last can be anything you like, but 'First is fixed. Doesn't that preclude slices that don't start at 'First? Supposing your declarations, can you call procedure Foo (Param : in out Integer_Array); like this: declare A : Integer_Array (1 .. 10) := (others => 0); begin Foo (A (3 .. 8)); end; ? -- Ludovic Brenta.