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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,eea0f90b41664ddc X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!news.glorb.com!multikabel.net!feed20.multikabel.net!border1.nntp.ams.giganews.com!nntp.giganews.com!proxad.net!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Extend Record in Spec and Body Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <1161012646.433304.176150@m7g2000cwm.googlegroups.com> Date: Tue, 17 Oct 2006 09:30:39 +0200 Message-ID: NNTP-Posting-Date: 17 Oct 2006 09:30:38 CEST NNTP-Posting-Host: 61ba9e67.newsspool2.arcor-online.net X-Trace: DXC=UVifc:PJ]lT[7Non7UCi8UA9EHlD;3YcR4Fo<]lROoRQ4nDHegD_]RU`:Cd01S3ZY^DNcfSJ;bb[UFCTGGVUmh?TN\HXHJ4e80^RQfniROV=aR X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:7004 Date: 2006-10-17T09:30:38+02:00 List-Id: On 16 Oct 2006 08:30:46 -0700, richard.charts@gmail.com wrote: > Is it possible to extend a record twice in a package? Yes, but not in the body and each extension would produce a new type. > I'm building a component now that will be mostly reusable. There are a > couple packages that are the same, but for one piece the differences > require different code. However, with the way it is designed, it seems > I could make the package specs the same and only alter the bodies. > I would like to try to hide part of the extended record from the > specification without having to change the operation declarations. You cannot do it in the body and you cannot do it so that both extensions were looked as one type. But you can make one extension public and another private: type Transient_Object is abstract new HigherPackage.object with record end record; type Object is new Transient_Object with private; private type Object is new Transient_Object with record end record; Well, if the public things are read-only you could expose them through getters using the prefix interface (new in Ada 2005), and then move everything into private. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de