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 2002:a24:7949:: with SMTP id z70mr17206866itc.36.1558179818969; Sat, 18 May 2019 04:43:38 -0700 (PDT) X-Received: by 2002:aca:d746:: with SMTP id o67mr17235116oig.157.1558179818600; Sat, 18 May 2019 04:43:38 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!weretis.net!feeder6.news.weretis.net!feeder.usenetexpress.com!feeder-in1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!u76no316156ita.0!news-out.google.com!p73ni291itp.0!nntp.google.com!u76no316152ita.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sat, 18 May 2019 04:43:38 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=89.131.20.193; posting-account=C8J7NQoAAAD_ybGY7--QIRi6KpLjoH1Z NNTP-Posting-Host: 89.131.20.193 References: <0ca05176-a819-4e9a-8c6c-3a0c1f32f964@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: constructor in abstract tagged types From: Daniel Injection-Date: Sat, 18 May 2019 11:43:38 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader01.eternal-september.org comp.lang.ada:56326 Date: 2019-05-18T04:43:38-07:00 List-Id: El s=C3=A1bado, 11 de mayo de 2019, 0:40:48 (UTC+2), Randy Brukardt escrib= i=C3=B3: > "Daniel" wrote in message=20 > ... > ... > >Option 2: > > > > return Son'(Father with > > Skate =3D>True); > > > >Problem: i cannot initialize Father or call any kind of constructor of= =20 > >Father > >becouse compiler don't let me make any kind of function of a abstract=20 > >tagged type. >=20 > Correct. But that's what you declared in this case, so I would assume tha= t=20 > you want to manually initialize all of the components. >=20 > If you have proper default values for the components, why not declare the= =20 > Father type that way?? Uninitialized stuff often leads to trouble anyway. >=20 > That is: >=20 > type Father is abstract tagged record > Years : Natural :=3D 0; > field1 : Natural :=3D 0; > -- .....and 15 more fields > end record; >=20 > If you *don't* want this sort of default value, then it only makes sense = to=20 > initialize all of the components when the object is first created. (Or yo= u=20 > could define a procedure to do it, as Dmitry showed. But you lose=20 > completeness checking when you do that.) >=20 > Randy. Thank you for your answer. Yes. In the real component i will want to initialize to some known value fo= r some attributes, but there are other that i need to change from the son c= onstructor.