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.4 required=5.0 tests=BAYES_00,FORGED_MUA_MOZILLA autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,56525db28240414a X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.224.76.205 with SMTP id d13mr6687326qak.3.1343138359424; Tue, 24 Jul 2012 06:59:19 -0700 (PDT) Received: by 10.216.60.144 with SMTP id u16mr1111173wec.10.1343138359305; Tue, 24 Jul 2012 06:59:19 -0700 (PDT) Received: by 10.66.74.6 with SMTP id p6mr119869pav.5.1343097999877; Mon, 23 Jul 2012 19:46:39 -0700 (PDT) Path: a15ni83832932qag.0!nntp.google.com!x2no288191qaj.0!news-out.google.com!ge7ni55238487wib.0!nntp.google.com!volia.net!news2.volia.net!feed-A.news.volia.net!p4no978957qas.0!news-out.google.com!b9ni44111485pbl.0!nntp.google.com!border1.nntp.dca.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!novia!feeder3.cambriumusenet.nl!194.109.133.84.MISMATCH!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!feeder2.cambriumusenet.nl!feed.tweaknews.nl!216.196.110.144.MISMATCH!border3.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!news.nobody.at!news.albasani.net!news.teledata-fn.de!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Sun, 15 Jul 2012 23:33:30 +0200 From: Georg Bauhaus User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:13.0) Gecko/20120614 Thunderbird/13.0.1 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Efficient Sequential Access to Arrays References: <01983f1c-f842-4b1f-a180-bcef531dad4c@googlegroups.com> <646635a0-ca6e-4f90-bfd7-90e9fd41f989@googlegroups.com> In-Reply-To: Message-ID: <5003372a$0$6555$9b4e6d93@newsspool4.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 15 Jul 2012 23:33:30 CEST NNTP-Posting-Host: 011a5c7f.newsspool4.arcor-online.net X-Trace: DXC=MC1Mc[ejVXa\BgjeC>?:WV2i On 15.07.12 22:16, Keean Schupke wrote: > I am not sure such a rigorous analysis is necessary though, consider the following: the language semantics could be changed to allow this by for example having a primitive iterator type on arrays that supported operations like: > > declare > J : Array_Iterator := Array(5); > begin > J := J + 1; > J.Property = Value; > end > > This would not expose the underlying machine architecture and would allow the kind of optimisations needed. J could have a range derived from the array bounds to bounds check the access. > > It seems obvious enough that I am wondering if there is a way to do this that I missed? IIUC, this would be along the lines of Ada 2012 iteration syntax (the "of" loop)? for J of Some_array_5 loop J.Property := Value; end loop; It is possible to define types that allow the above for containers, not sure whether this extends to arrays.