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:a05:6638:606:: with SMTP id g6mr29534053jar.129.1557340644094; Wed, 08 May 2019 11:37:24 -0700 (PDT) X-Received: by 2002:aca:d7c6:: with SMTP id o189mr3397308oig.2.1557340643408; Wed, 08 May 2019 11:37:23 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.dns-netz.com!news.freedyn.net!newsreader4.netcologne.de!news.netcologne.de!peer03.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.am4!peer.am4.highwinds-media.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!b2no55987itd.0!news-out.google.com!v189ni13itv.0!nntp.google.com!b2no55986itd.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 8 May 2019 11:37:23 -0700 (PDT) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=94.126.240.2; posting-account=C8J7NQoAAAD_ybGY7--QIRi6KpLjoH1Z NNTP-Posting-Host: 94.126.240.2 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <0ca05176-a819-4e9a-8c6c-3a0c1f32f964@googlegroups.com> Subject: constructor in abstract tagged types From: Daniel Injection-Date: Wed, 08 May 2019 18:37:24 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Received-Bytes: 2567 X-Received-Body-CRC: 498532835 Xref: reader01.eternal-september.org comp.lang.ada:56260 Date: 2019-05-08T11:37:23-07:00 List-Id: Hello, im trying to know how can i use abstract tagged types and constructo= rs at the same time. I have this package FATHERS is type Father is abstract tagged record Years : Natural; field1 : Natural; -- .....and 15 more fields end record; function F_build(Years :Natural) return Father is abstract; procedure F_forced_to_do_it is abstract; end FATHERS; package FATHERS.SONS is type Son is new father with record skate : boolean; end Son; function F_Build(Years :Natural) return Son; procedure F_Forced_to_do_it; end FATHERS.SONS; package body FATHERS.SONS is function F_Build(Years : Natural) return Son is begin =C2=BF?=C2=BF?=C2=BF?=C2=BF?=C2=BF? end F_Build; end FATHERS.SONS; --------------------------------- So the question is How can i make the constructor F_Build of the Son? Option 1: return son'(Years =3D> Years, field1 =3D> =C2=BF?, field2 =3D> =C2=BF?. ... field15 =3D> ?=C2=BF Problem: put 15 fields by hand for every type of son.. really annoying. Option 2: return Son'(Father with Skate =3D>True); Problem: i cannot initialize Father or call any kind of constructor of Fath= er becouse compiler don't let me make any kind of function of a abstract ta= gged type. Regards, Daniel.