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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,ca20ac98709f9b4a X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!y21g2000hsf.googlegroups.com!not-for-mail From: mockturtle Newsgroups: comp.lang.ada Subject: Re: Array of Strings Date: Tue, 23 Sep 2008 07:30:37 -0700 (PDT) Organization: http://groups.google.com Message-ID: <03c0a846-728a-4944-9529-9b941f7361e9@y21g2000hsf.googlegroups.com> References: <0e021c61-535a-4935-95ad-2a241fa7302f@e53g2000hsa.googlegroups.com> NNTP-Posting-Host: 158.110.27.34 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1222180238 27173 127.0.0.1 (23 Sep 2008 14:30:38 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 23 Sep 2008 14:30:38 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: y21g2000hsf.googlegroups.com; posting-host=158.110.27.34; posting-account=9fwclgkAAAD6oQ5usUYhee1l39geVY99 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.0.7-1.1.fc3 Firefox/1.0.7,gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:7802 Date: 2008-09-23T07:30:37-07:00 List-Id: On Sep 23, 4:07 pm, jedivaughn wrote: > If I wanted to make a package that made the array generic how would I > go about doing this. this is what I have which isn't working. > > generic > > type Element_Type is (<>); > type range1 is (<>); > > package list is > type letters is private; > > private > type letters is array (range1) of Element_Type; > > end list; > > and then in the main program I want > > subtype range2 is integer range 1..25; > subtype str_length is string (1..25); > > package List1 is new List(Element_Type => str_length, range1 => > range2 ); > > when I try to compile the main program I get "expect discrete type in > instantiation of "Element_Type"" > > what am I doing wrong? > According to RM 12.5.2 "type Element_Type is (<>);" means that Element_Type is a discrete type. I guess that you want something like "type Element_Type is private;" (I did not check) > Thanks, > John