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=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC 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: Andy Subject: Re: tagged types extensions - language design question Date: 2000/01/28 Message-ID: <38918156.7C35@nospam.com.tj>#1/1 X-Deja-AN: 578700384 Cache-Post-Path: news.ozonline.com.au!unknown@melb-pool-153.ozonline.com.au Content-Transfer-Encoding: 7bit References: <867lgvs47x.fsf@ppp-112-253.villette.club-internet.fr> Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@connect.com.au X-Trace: perki.connect.com.au 949056281 19514 203.4.248.42 (28 Jan 2000 10:44:41 GMT) Organization: Australia On Line Pty Ltd Mime-Version: 1.0 Reply-To: andy@nospam.com.tj NNTP-Posting-Date: 28 Jan 2000 10:44:41 GMT Newsgroups: comp.lang.ada Date: 2000-01-28T10:44:41+00:00 List-Id: Vladimir Olensky wrote: > > Laurent Guerby wrote in message > <867lgvs47x.fsf@ppp-112-253.villette.club-internet.fr>... --- snipped --- > >What about: > > > > type T1_Private is private; > > > > type T1 is new T with record > > something_public : some_type; > > something_private : T1_Private; > > end record; > > > >private > > > > type T1_Private is record > > -- whatever... > > end record; > > > >> 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. > > > >Looks like it's easy to emulate, at least in the simple case you > >provided. > > This is not very good as in this case the layout oh the descendant > (common part) will be different from the layout of it's private parent > type that serves as a common root to several different "children" > and some of them may have additional public (visible fields) > together with additional private fields. Not sure what you mean by the 'layout'. The private parts are private, the child types should not care about the layout of the private data (unless they themselves are located in child packages and therefore have visibility to their parent's private bits). In regards to your original question: why isn't both a public and private extention allowed at the same time? I expect it is to avoid an overley complicated syntax to acheive something that can effectively be acheived by other (at least two suggested in this thread) means. ___________________________________________ Andy ___________________________________________ (sorry if this is a duplicate - I had an error on the first attempt)