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,5b3aa4bc9027f04e X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!border1.nntp.dca.giganews.com!nntp.giganews.com!wns14feed!worldnet.att.net!attbi_s22.POSTED!53ab2750!not-for-mail From: "Jeffrey R. Carter" User-Agent: Thunderbird 2.0.0.19 (Windows/20081209) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Unconstrained Arrays References: <1a8008fb-c840-45bc-824c-d10eec9fe569@d36g2000prf.googlegroups.com> <0caa9cf8-0620-4544-9b2c-2c9f24142b7f@v23g2000pro.googlegroups.com> In-Reply-To: <0caa9cf8-0620-4544-9b2c-2c9f24142b7f@v23g2000pro.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: NNTP-Posting-Host: 173.16.158.68 X-Complaints-To: abuse@mchsi.com X-Trace: attbi_s22 1237267231 173.16.158.68 (Tue, 17 Mar 2009 05:20:31 GMT) NNTP-Posting-Date: Tue, 17 Mar 2009 05:20:31 GMT Organization: AT&T ASP.att.net Date: Tue, 17 Mar 2009 05:20:31 GMT Xref: g2news1.google.com comp.lang.ada:4154 Date: 2009-03-17T05:20:31+00:00 List-Id: belteshazzar wrote: > > type Unconstrained_Array is array ( Integer range <> ) of Integer; > type Unconstrained_Array_Pointer is access all Unconstrained_Array; > > procedure F (S : in Unconstrained_Array_Pointer); > > V : Unconstrained_Array := (1 .. 10_000 => 0); > V_Ptr : Unconstrained_Array_Ptr := > Unconstrained_Array'unchecked_Access > > F (V_Ptr); If you do procedure F (S : in Unconstrained_Array); V : Unconstrained_Array (-10_000 .. -1); -- You must do things like this, since your index subtype is Integer. -- If you intended only positive indices, surely you would use Positive. F (S => V); I know of no compiler that will not use pass by reference. -- Jeff Carter "Drown in a vat of whiskey. Death, where is thy sting?" Never Give a Sucker an Even Break 106