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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,eea0f90b41664ddc X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!i42g2000cwa.googlegroups.com!not-for-mail From: "Richard Charts" Newsgroups: comp.lang.ada Subject: Re: Extend Record in Spec and Body Date: 16 Oct 2006 10:20:11 -0700 Organization: http://groups.google.com Message-ID: <1161019211.319933.248220@i42g2000cwa.googlegroups.com> References: <1161012646.433304.176150@m7g2000cwm.googlegroups.com> <0ed0he.ife.ln@hunter.axlog.fr> NNTP-Posting-Host: 12.129.98.129 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1161019216 5731 127.0.0.1 (16 Oct 2006 17:20:16 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 16 Oct 2006 17:20:16 +0000 (UTC) In-Reply-To: <0ed0he.ife.ln@hunter.axlog.fr> User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.7) Gecko/20060909 Firefox/1.5.0.7,gzip(gfe),gzip(gfe) X-HTTP-Via: 1.1 S1PS Complaints-To: groups-abuse@google.com Injection-Info: i42g2000cwa.googlegroups.com; posting-host=12.129.98.129; posting-account=ydtQyAwAAAC1xxzVoGOYbHSW6zGrdJDV Xref: g2news2.google.com comp.lang.ada:6994 Date: 2006-10-16T10:20:11-07:00 List-Id: Jean-Pierre Rosen wrote: > richard.charts@gmail.com a =E9crit : > > Is it possible to extend a record twice in a package? > > 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. > > > > I included a small slice of what I'm trying to do. Is this even > > possible? > > Thanks. > > > > SPEC: > > > > private > > type Object is new HigherPackage.object > > with record > > Repo_View : Repo_View_Array; > > end record; > > > > end spec; > > > > body > > type Object is new HigherPackage.object -- This is where I'm not > > sure how to proceed > > with record > > Data: Data_Array; > > Ack: boolean; > > end record; > > > This is not allowed as stated, but you could derive an Internal_Object > from Object in the body, and add conversions where needed. > > -- > --------------------------------------------------------- > J-P. Rosen (rosen@adalog.fr) > Visit Adalog's web site at http://www.adalog.fr As a kind of similar question, is it legal to extend an object and have the new object be variant? type Object (Type: New_Type is new HigherPackage.object with record Repo_View : Repo_View_Array; case Type is Something =3D> Test : Natural; end record;