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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,604e0f87aa06eab6 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-03-23 00:59:14 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!headwall.stanford.edu!fu-berlin.de!uni-berlin.de!dialin-145-254-037-051.arcor-ip.NET!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Imitation is the sincerest form of flattery Date: Sun, 23 Mar 2003 10:01:04 +0100 Organization: At home Message-ID: References: <1047665830.579605@master.nyc.kbcfp.com> <7eee7v4hpvj0i5s345uonlen5315rhiau8@4ax.com> <4dkea.75440$gi1.38045@nwrdny02.gnilink.net> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: dialin-145-254-037-051.arcor-ip.net (145.254.37.51) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: fu-berlin.de 1048409952 78372903 145.254.37.51 (16 [77047]) User-Agent: KNode/0.7.1 Xref: archiver1.google.com comp.lang.ada:35631 Date: 2003-03-23T10:01:04+01:00 List-Id: AG wrote: > "Pascal Obry" wrote in message > news:ubs03lcdz.fsf@wanadoo.fr... > >> You mean that the compiler must generate a call to >> Set_Element/Get_Element > for >> every reference to an array item, right ? > > Well, I don't know what Dmitry meant of course :) > > But my case would be that of the compiler knowing > pretty darn well what the index is - it could be just > a simple integer or so. The whole point is not about > hiding the info from the compiler (how could you?) > but about hiding/decoupling it from the clients of > the package. And keeping control of it. And being > able to change it without breaking all the clients ... This is a more specialized problem. And yes, of course, there has to be universal index types. For example: type My_Index is private index; -- Have to implement 'Succ, 'Pred, 'Range etc type My_Array is array (My_Index range <>) of Something; Here index is private, array is public. The most general case is when everything: index, element, and array are private: type Item is private; type Key is private index; -- Have to implement 'Succ, 'Pred, 'Range etc type Table is private array (Key range <>) of Item; -- Have to implement Get, Set, Slice etc. -- Regards, Dmitry A. Kazakov www.dmitry-kazakov.de