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=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,54a7591bed8148f2 X-Google-Attributes: gid103376,public Path: g2news1.google.com!news2.google.com!proxad.net!usenet-fr.net!enst.fr!melchior!cuivre.fr.eu.org!melchior.frmug.org!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: Record representation Date: 09 Jun 2004 20:38:10 -0400 Organization: Cuivre, Argent, Or Message-ID: References: <40c6d3d1$1_1@baen1673807.greenlnk.net> NNTP-Posting-Host: lovelace.ada-france.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: melchior.cuivre.fr.eu.org 1086827906 45077 212.85.156.195 (10 Jun 2004 00:38:26 GMT) X-Complaints-To: usenet@melchior.cuivre.fr.eu.org NNTP-Posting-Date: Thu, 10 Jun 2004 00:38:26 +0000 (UTC) To: comp.lang.ada@ada-france.org Return-Path: In-Reply-To: <40c6d3d1$1_1@baen1673807.greenlnk.net> User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 X-Virus-Scanned: by amavisd-new-20030616-p7 (Debian) at ada-france.org X-BeenThere: comp.lang.ada@ada-france.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Gateway to the comp.lang.ada Usenet newsgroup" List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: g2news1.google.com comp.lang.ada:1341 Date: 2004-06-09T20:38:10-04:00 "Martin Dowie" writes: > Is there anything that could be done (quickly ;-) by the ARG for Ada200Y to > do something about this common pain in the *ss? > > package Record_Rep is > > type A is record > I : Integer; > end record; > for A'Size use Integer'Size; > Max_Index : constant := 10; > type Index is new Integer range 1 .. 10; type Index is new Integer range 1 .. Max_Index; > > type AA is array (Index) of A; > for AA'Size use A'Size * Index'Last; -- Not allowed!!!!! for AA'Size use A'Size * Max_Index; > end Record_Rep; > > Surely the language could be made smart enough to support this? This can be > a real maintenance nightmare to change. If Ada doesn't let you do it, there is a better way :). On the other hand, I agree it would be nice if Index'Last were static in this instance. But 'Last can't be static in general, so it's reasonable for it to be never static. -- -- Stephe