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: Charles Hixson Subject: Re: tagged types extensions - language design question Date: 2000/01/27 Message-ID: <389088A3.6BD25457@earthlink.net>#1/1 X-Deja-AN: 578397860 Content-Transfer-Encoding: 7bit References: X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-ELN-Date: Thu Jan 27 10:04:31 2000 X-Complaints-To: abuse@earthlink.net X-Trace: newsread1.prod.itd.earthlink.net 948996271 198.94.156.19 (Thu, 27 Jan 2000 10:04:31 PST) Organization: EarthLink Network, Inc. MIME-Version: 1.0 NNTP-Posting-Date: Thu, 27 Jan 2000 10:04:31 PST Newsgroups: comp.lang.ada Date: 2000-01-27T00:00:00+00:00 List-Id: That should work, but the question was why couldn't it be done in one step. (I don't know.) Matthew Heaney wrote: > 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 > > > >