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: 103376,2ac407a2a34565a9 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.129.169 with SMTP id nx9mr5200117pbb.2.1330592107588; Thu, 01 Mar 2012 00:55:07 -0800 (PST) Path: h9ni26076pbe.0!nntp.google.com!news1.google.com!goblin3!goblin2!goblin.stu.neva.ru!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Array Help? Date: Thu, 1 Mar 2012 09:54:46 +0100 Organization: cbb software GmbH Message-ID: <123dqk23rvyf0$.iuh8anhb1hl7.dlg@40tude.net> References: <10615783-d4a9-4cbd-8971-53ba1100d6a0@b18g2000vbz.googlegroups.com> <17412419.40.1330534213855.JavaMail.geo-discussion-forums@vbva11> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: FbOMkhMtVLVmu7IwBnt1tw.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-03-01T09:54:46+01:00 List-Id: On Wed, 29 Feb 2012 18:15:52 -0500, Robert A Duff wrote: > Ada allows you to fix 'First and 'Last, and it allows you to let > both vary. What's missing is a way to fix 'First, but allow > 'Last to vary. I sort of implied that a predicate should do that, > but that's wrong. There should be SOME way to do it. And for > completeness, I'd allow fixing 'Last, but allowing 'First to vary, > although that's much less useful. That sort of thing has nothing to do with constraining, so the idea to get it using a predicate is straight wrong. > I'm certainly not saying "all arrays should start at 1". I'm saying > "there should a way to declare an array type such that all objects of > that type start at 1 (or any other value) while allowing 'Last to > vary". The array abstraction is that the given index denotes the *same* array element. Sliding indices is another abstraction (ordinal, sequence) and it does not require arrays having separate index types. Ordinals are same for all sequences. The point is that all cases where you wanted arrays to start from some element are actually views on an array as a sequence of elements. Provide that view and the problem would vanish. This would also eliminate the problem of constructing empty arrays and simplify generics dealing with arrays. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de