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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,fa2cc518ef3b992c X-Google-Attributes: gid103376,public From: "Matthew Heaney" Subject: Re: tagged types extensions - language design question Date: 2000/01/27 Message-ID: #1/1 X-Deja-AN: 578376461 Content-transfer-encoding: 7bit References: Content-Type: text/plain; charset="US-ASCII" X-ELN-Date: Thu Jan 27 09:01:24 2000 X-Complaints-To: abuse@earthlink.net X-Trace: newsread2.prod.itd.earthlink.net 948992484 38.26.192.154 (Thu, 27 Jan 2000 09:01:24 PST) Organization: EarthLink Network, Inc. Mime-version: 1.0 NNTP-Posting-Date: Thu, 27 Jan 2000 09:01:24 PST Newsgroups: comp.lang.ada Date: 2000-01-27T00:00:00+00:00 List-Id: In article , "Vladimir Olensky" wrote: Why don't you just declare these types in separate packages? package P is type T is tagged private; private type T is tagged record ...; end P; package P.C is type T1_Public is abstract new T with record Something : Some_Other_Type; end record; type T1 is new T1_Public with private; private type T1 is new T1_Public with record ... ; end P.C; > package P is > > type T is tagged private; > > type T1 is new T with > record with private > something: some_type; > and record; > > private > > type T is tagged with > record > ID : Integer; > end record; > > type T1 is new T with > record > thing : some_other_type; > end record; > > end P; > > Instead I should do this in two steps. > 1. to extend private part and then > 2. to extend public part > or vice versa. > > Due to that type T1 has inheritance_depth = 3 > instead of inheritance_depth = 2. > > LRM (3.9.1) says: > Every type extension is a tagged type, > and is EITHER a record extension OR a private > extension of some other tagged type. > > It would be interesting to know what were > the reasons not to allow to have BOTH a record > extension AND a private extension at the same time. > > Regards, > Vladimir Olensky > >