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/29 Message-ID: <3892BABB.290D@nospam.com.tj>#1/1 X-Deja-AN: 579093526 Cache-Post-Path: news.ozonline.com.au!unknown@melb-pool-148.ozonline.com.au Content-Transfer-Encoding: 7bit References: <867lgvs47x.fsf@ppp-112-253.villette.club-internet.fr> <38918156.7C35@nospam.com.tj> Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@connect.com.au X-Trace: perki.connect.com.au 949136507 12010 203.4.248.42 (29 Jan 2000 09:01:47 GMT) Organization: Australia On Line Pty Ltd Mime-Version: 1.0 Reply-To: andy@nospam.com.tj NNTP-Posting-Date: 29 Jan 2000 09:01:47 GMT Newsgroups: comp.lang.ada Date: 2000-01-29T09:01:47+00:00 List-Id: Vladimir Olensky wrote: > Actually the problem is that naming scheme becomes more > complicated as I need to invent names for such intermediate > packages and everything should be clean and easily understandable. > Although it is good practice to have each child class type in its own package, if the intermediate type is just to allow a double extension (one public, one private), why not just do so in the one package, something like: -- Root class -- package P1 is type Root is abstract tagged null record; procedure Method (X : in Root) is abstract; end P1; -- Child class -- package P1.P2 is -- public extension -- this is abstract so we don't have to override any -- abstract operations defined by the paraent class. -- type Intermediates is abstract new P1.Root with record F : Float; -- etc. end record; type Objects is new Intermediates with private; procedure Method (X : in Objects); private type Objects is new Intermediates with record I : Integer; -- etc. end record; end P1.P2; Cheers Andy