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 autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.13.238.67 with SMTP id x64mr2090366ywe.102.1483616472004; Thu, 05 Jan 2017 03:41:12 -0800 (PST) X-Received: by 10.157.18.211 with SMTP id g77mr3621136otg.14.1483616471963; Thu, 05 Jan 2017 03:41:11 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!1.eu.feeder.erje.net!feeder.erje.net!2.us.feeder.erje.net!newspeer1.nac.net!border2.nntp.dca1.giganews.com!nntp.giganews.com!d45no276828qta.0!news-out.google.com!g131ni8193itg.0!nntp.google.com!b123no518099itb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 5 Jan 2017 03:41:11 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=194.154.216.92; posting-account=sDyr7QoAAAA7hiaifqt-gaKY2K7OZ8RQ NNTP-Posting-Host: 194.154.216.92 References: <29380aa7-0c3b-4908-94c6-aa91f3996b42@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <580eb363-2195-43f3-a589-b01657a1be43@googlegroups.com> Subject: Re: Experimenting with the OOP features in Ada From: Laurent Injection-Date: Thu, 05 Jan 2017 11:41:11 +0000 Content-Type: text/plain; charset=UTF-8 Xref: news.eternal-september.org comp.lang.ada:33066 Date: 2017-01-05T03:41:11-08:00 List-Id: On Wednesday, 4 January 2017 13:44:31 UTC+1, Dmitry A. Kazakov wrote: > On 2017-01-04 13:18, Laurent wrote: > > > Other thing I don't understand: > > > > > > > > For the persistent storage solution I need those handles. > > > > > > Actually the base type for persistent objects is > Object.Archived.Deposit. Object.Entity is merely a reference-counted > object. Object.Archived.Deposit is that plus operations to > serialize/deserialize and handle inter-object dependencies/references. > > > Ok. Until now I didn't read any further than the Safe_String example, so I copied its structure. > > If you are not going to change string components you could simply do > > type Object (Name_Length : Positive; Code_SIL_Length : Positive) is > abstract new Object.Entity with > record > Name : String (1..Name_Length); > Code_SIL : String (1..Code_SIL_Length); > end record; > > > type Base_Type_Ptr is access Object'Class; > > > > > > > > end Base_Types; > > > > > > > > > > > >> > > > I think I leave it for the moment as it is. > > There seems to be no place where I can insert an tagged keyword? > > > > > > Object.Entity and Object.Archived.Deposit are already tagged. > > > And that is why there is no place to put it? Or does abstract automatically implies tagged? > The package name Object gets hidden by the declaration the type Object. > Change it to: > > type Object is abstract new Standard.Object.Entity ... > Why Standard? Thought that was for libraries which come preinstalled? I thought I get access to Simple Components via Gnoga? So previous errors are gone, a new one: base_types-antibiotics.ads:30:9: type must be declared abstract or "Get_Class" overridden So I looked at Get_Class. -- Get_Class -- Of an object -- -- Object - The object -- -- This function returns the class of Object. The class is a string -- uniquely describing the object's type. It is analogous to external -- type tag representation. Though, different types of objects may have -- same class if necessary. -- -- Returns : -- -- The object class -- function Get_Class (Object : Deposit) return String is abstract; Hm is abstract, so no body to copy from. What is it doing? If Object is of type ie.: Base_Type it will return a String with Base_Type? Thanks