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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC 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.66.74.40 with SMTP id q8mr3110073pav.19.1343789444529; Tue, 31 Jul 2012 19:50:44 -0700 (PDT) Path: g9ni9635140pbo.0!nntp.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nrc-news.nrc.ca!goblin2!goblin.stu.neva.ru!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Efficient Sequential Access to Arrays Date: Fri, 27 Jul 2012 10:50:41 +0200 Organization: cbb software GmbH Message-ID: <1h8xwpi5nyutn$.1odo6yd8h8xhx$.dlg@40tude.net> References: <01983f1c-f842-4b1f-a180-bcef531dad4c@googlegroups.com> <87ipdf4vh6.fsf@mid.deneb.enyo.de> <4ce44d2d-d789-42a0-a6ed-035f7f8d58be@googlegroups.com> <9c180f15-28b5-46ca-929d-b731058d0a97@googlegroups.com> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: 9A8bJrx4NhDLcSmbrb6AdA.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Date: 2012-07-27T10:50:41+02:00 List-Id: On Fri, 27 Jul 2012 01:21:18 -0700 (PDT), Keean Schupke wrote: > I am wondering if there is a way to use address arithmetic that would be > just as safe as array indexing? What about something like: > > > type Value_Type is limited private; > type Index_Type is range <>; > type Array_Type is array (Index_Type) of Value_Type; > > A : Array_Type; > > type Iterator = Address_Integer range A(A'First)'Address .. A(A'Last)'Address step Value_Type'Size; > > This would be safe as it could only contain the address of a valid record > in the array, and the syntax could be neat with automatic dereferencing. Value_Type = Boolean -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de