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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,ffc9e2fe760c58fd X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!u72g2000cwu.googlegroups.com!not-for-mail From: "Steve Whalen" Newsgroups: comp.lang.ada Subject: Re: Records that could be arrays Date: 25 Feb 2006 19:24:32 -0800 Organization: http://groups.google.com Message-ID: <1140924272.052117.106800@u72g2000cwu.googlegroups.com> References: <189zs75645p7g.1usdp56yox0lg$.dlg@40tude.net> NNTP-Posting-Host: 70.110.32.96 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1140924277 32748 127.0.0.1 (26 Feb 2006 03:24:37 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sun, 26 Feb 2006 03:24:37 +0000 (UTC) User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: u72g2000cwu.googlegroups.com; posting-host=70.110.32.96; posting-account=GBMmzA0AAABrZ0dHOASa3b2Cdf-RliH9 Xref: g2news1.google.com comp.lang.ada:3164 Date: 2006-02-25T19:24:32-08:00 List-Id: Dmitry A. Kazakov wrote: > ... The rest is a question of language deficiency. In this case an > inability to provide an array interface to a record type (to have > enumerated components), or a record interface to an array (to have named > components.) ... I'm not sure what you mean by a language deficiency. If you really want to address an object as either a record or an array, doesn't something like this meet your needs? with Ada.Text_IO; use Ada.Text_IO; with Ada.Integer_Text_IO; use Ada.Integer_Text_IO; procedure Redefine is type IntRecord is record FirstInt : Integer; SecondInt : Integer; end record; type IntArray is array (1 .. 2) of Integer; RecVar : IntRecord := (FirstInt => 1, SecondInt => 2); ArrayVar : IntArray; for ArrayVar'Address use RecVar'Address; begin Put("First Record Element = "); Put(RecVar.FirstInt); New_Line; Put("Array Element 2 = "); Put(ArrayVar(2)); New_Line; end Redefine;