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-11 00:46:01 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!nntp.cs.ubc.ca!cyclone.bc.net!news-out.newsfeeds.com!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 21:47:29 -0800 NNTP-Posting-Host: 219.88.61.55 X-Complaints-To: newsadmin@xtra.co.nz X-Trace: news.xtra.co.nz 1042274760 219.88.61.55 (Sat, 11 Jan 2003 21:46:00 NZDT) NNTP-Posting-Date: Sat, 11 Jan 2003 21:46:00 NZDT Organization: Xtra Xref: archiver1.google.com comp.lang.ada:32909 Date: 2003-01-11T21:47:29-08:00 List-Id: "James S. Rogers" wrote in message news:TwPT9.105450$hK4.8563792@bgtnsc05-news.ops.worldnet.att.net... > "AG" wrote in message > > 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? > > I am unclear what you mean by "providing appropriate operations" > without allowing direct manipulation. This sounds like an iterator to > me. Please describe what you have in mind instead. > OK, here it is: package test is type X is new Integer; -- What I'd like here is "limited private" instead of "new integer" type Test is array(X) of Boolean; function "+"(Left: X) return X; -- Unary increment (however that may be implemented) function "+"(Left:X; N: Integer) return X; -- Shift by N positions (does not equal N times other "+") private -- Defiinition of "X" here whatever it may be end test; The code above compiles fine. Replacing "new Integer" with "limited private" does not. But, if it did, it would allow the user of the package to do things like 10th position from wherever the index is now and it would be the responsibility of the implementation to know what/where it is. At the same time, the client package would have no clue as to what the type is or be able to operate on it directly (only through any functions provided by the package which was the whole point).