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 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!gandalf.srv.welterde.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: constructor in abstract tagged types Date: Fri, 10 May 2019 17:40:46 -0500 Organization: JSA Research & Innovation Message-ID: References: <0ca05176-a819-4e9a-8c6c-3a0c1f32f964@googlegroups.com> Injection-Date: Fri, 10 May 2019 22:40:47 -0000 (UTC) Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226"; logging-data="3612"; mail-complaints-to="news@jacob-sparre.dk" X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246 Xref: reader01.eternal-september.org comp.lang.ada:56288 Date: 2019-05-10T17:40:46-05:00 List-Id: "Daniel" wrote in message news:0ca05176-a819-4e9a-8c6c-3a0c1f32f964@googlegroups.com... ... >Option 2: > > return Son'(Father with > Skate =>True); > >Problem: i cannot initialize Father or call any kind of constructor of >Father >becouse compiler don't let me make any kind of function of a abstract >tagged type. Correct. But that's what you declared in this case, so I would assume that you want to manually initialize all of the components. If you have proper default values for the components, why not declare the Father type that way?? Uninitialized stuff often leads to trouble anyway. That is: type Father is abstract tagged record Years : Natural := 0; field1 : Natural := 0; -- .....and 15 more fields end record; If you *don't* want this sort of default value, then it only makes sense to initialize all of the components when the object is first created. (Or you could define a procedure to do it, as Dmitry showed. But you lose completeness checking when you do that.) Randy.