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, LOTS_OF_MONEY autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,602b7f606b0d64e2 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-01-10 19:07:58 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!gestalt.direcpc.com!telocity-west!DIRECTV!news-out.spamkiller.net!propagator2-maxim!news-in.spamkiller.net!news02.tsnz.net!newsfeed01.tsnz.net!news.xtra.co.nz!53ab2750!not-for-mail From: "AG" Newsgroups: comp.lang.ada References: <8pLT9.105190$hK4.8530896@bgtnsc05-news.ops.worldnet.att.net> Subject: Re: Private discrete type as index X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Message-ID: Date: Sat, 11 Jan 2003 16:09:30 -0800 NNTP-Posting-Host: 219.88.61.134 X-Complaints-To: newsadmin@xtra.co.nz X-Trace: news.xtra.co.nz 1042254477 219.88.61.134 (Sat, 11 Jan 2003 16:07:57 NZDT) NNTP-Posting-Date: Sat, 11 Jan 2003 16:07:57 NZDT Organization: Xtra Xref: archiver1.google.com comp.lang.ada:32902 Date: 2003-01-11T16:09:30-08:00 List-Id: "James S. Rogers" wrote in message news:8pLT9.105190$hK4.8530896@bgtnsc05-news.ops.worldnet.att.net... > At the point of declaration of the array type the index type > is not specified as a discrete type. The array type is not private. > The nature of the index type must be visible within the scope of > the declaration of the array type. True, and the example you give below is fine *if* you want to hide from the user the fact that the construct is an array (that's what I meant by "iterator"). However, what if you want to let your clients know that that the structure is indeed an array and provide appropriate operations on the index but prevent them from directly manipulating it? > > You can try an approach like the following, which does compile: > > package Type_Definition is > type Index_Type is limited private; > private > type Index_Type is new Integer range 1..10; > end Type_Definition; > > package Type_Definition.Collection is > type Collection is limited private; > private > type Collection is array(Index_Type) of Boolean; > end Type_Definition.Collection;