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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no 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: g2news2.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad.newshosting.com!newshosting.com!198.186.194.250.MISMATCH!news-xxxfer.readnews.com!transit4.readnews.com!news-out.readnews.com!postnews3.readnews.com!not-for-mail Newsgroups: comp.lang.ada Subject: Re: Unconstrained Arrays From: "Peter C. Chapin" References: <1a8008fb-c840-45bc-824c-d10eec9fe569@d36g2000prf.googlegroups.com> <0caa9cf8-0620-4544-9b2c-2c9f24142b7f@v23g2000pro.googlegroups.com> <386b0e00-a1c6-4c5f-adf7-89b8543d0e2d@c11g2000yqj.googlegroups.com> Message-ID: User-Agent: Xnews/5.04.25 Date: 20 Mar 2009 01:53:28 GMT Organization: SoVerNet (sover.net) NNTP-Posting-Host: c9c03197.news.sover.net X-Trace: DXC=c@I2Cc^bI5=]O[;Ogh^:=3K6_LM2JZB_3CSHIc8[9`153?@`i3kGa5;O];I[ofTNg1Cj_II=7N7:= X-Complaints-To: abuse@sover.net Xref: g2news2.google.com comp.lang.ada:5167 Date: 2009-03-20T01:53:28+00:00 List-Id: belteshazzar wrote in news:386b0e00-a1c6-4c5f-adf7-89b8543d0e2d@c11g2000yqj.googlegroups.com: > Unfortuantely this is an optimisation and actually doesn't occur with > optimisation off. (I just ran a test program). I'm told that due to > the significant performance hit of the array initialisers when > optimisation is turned off we can't use that. Are those initializers actually necessary? type Unconstrained_Array is array(Integer range <>) of Integer; My_Array : Unconstrained_Array(-10_000 .. 10_000); In the above the array is uninitialized. Yes, you have to provide constraints, but you don't have to initialize the array here (obviously you'll need to do so eventually... perhaps as part of your algorithm). The code you showed use an array aggregate to initialize the array... the constraints where taken from the initializer. However, there are other ways to specify the constraints. Or am I totally confused? Peter