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:50:05 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 09:51:55 +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 1048409403 76778006 145.254.37.51 (16 [77047]) User-Agent: KNode/0.7.1 Xref: archiver1.google.com comp.lang.ada:35630 Date: 2003-03-23T09:51:55+01:00 List-Id: Pascal Obry wrote: > "Dmitry A. Kazakov" writes: > >> > But how do you access element into this array, what would be done >> > for: >> > >> > M : Sparse_Matix (1 .. 7, 1 .. 90); >> > >> > M (2, 6) := ...; >> >> I have to prove an implementation for Set_Element, I suppose. When I >> declare that Sparse_Matrix an array, I have to override all the abstract >> methods of the universal array type might have. Set_Element is one of >> them. > > You mean that the compiler must generate a call to Set_Element/Get_Element > for every reference to an array item, right ? Surely > So what you are looking for is a type with runtime support, a bit like > Ada.Finalization API with the Initialize/Adjust/Finalize routines, right ? There cannot be other mechanism I suppose. An universal array has some abstract primitive operations which has to be implemented. In case of built-in arrays, the implementeation is generated by the compiler. For user-defined ones, it is the programmer who implements them. However, I am pretty aware that all unsolved problems with assignment/construction in Ada will inevitable show themselves for Set_Element. -- Regards, Dmitry A. Kazakov www.dmitry-kazakov.de