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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,d67ca8d922a33c8a,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-02-29 17:55:28 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!news-stoc.telia.net!217.209.241.210.MISMATCH!news-stod.telia.net!telia.net!masternews.telia.net.!newsc.telia.net.POSTED!not-for-mail From: =?ISO-8859-1?Q?Bj=F6rn_Persson?= User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.1) Gecko/20031114 X-Accept-Language: sv, en-us MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Heterogenous array Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Message-ID: Date: Mon, 01 Mar 2004 01:53:25 GMT NNTP-Posting-Host: 217.209.116.179 X-Complaints-To: abuse@telia.com X-Trace: newsc.telia.net 1078106005 217.209.116.179 (Mon, 01 Mar 2004 02:53:25 CET) NNTP-Posting-Date: Mon, 01 Mar 2004 02:53:25 CET Organization: Telia Internet Xref: archiver1.google.com comp.lang.ada:5962 Date: 2004-03-01T01:53:25+00:00 List-Id: I need an array type that can hold elements of different types. My=20 current attempt (somewhat simplified) is below. My question is, is there = a way to do this without pointers? type T_Param_Type is (Int, Str); type Parameter_Definition(Param_Type : T_Param_Type) is record Name : A_Bounded_String_Type; case Param_Type is when Int =3D> Min : Integer; Max : Integer; Int_Value : Integer; when Str =3D> Str_Value : Ada.Strings.Unbounded.Unbounded_String; end case; end record; type Parameter_Definition_Pointer is access Parameter_Definition; type Parameter_Spec is array(Positive range <>) of Parameter_Definition_Pointer; "array(Positive range <>) of Parameter_Definition" gave me the error=20 "unconstrained element type in array declaration". I also tried a tagged = type with subtypes and "array(Positive range <>) of=20 Parameter_Definition'Class", and got the same error. This isn't really a dynamic data structure so I feel that pointers=20 shouldn't be necessary. Any ideas? --=20 Bj=F6rn Persson jor ers @sv ge. b n_p son eri nu