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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,33afa3244ab891f7 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news4.google.com!out01b.usenetserver.com!news.usenetserver.com!in04.usenetserver.com!news.usenetserver.com!uns-out.usenetserver.com!news.usenetserver.com!pc02.usenetserver.com!news.flashnewsgroups.com-b7.4zTQh5tI3A!not-for-mail Newsgroups: comp.lang.ada Subject: Re: Specialization generic package parameters References: <1996bbhvwjxcr$.1s16brw83713g$.dlg@40tude.net> From: Stephen Leake Date: Sat, 24 May 2008 08:48:40 -0400 Message-ID: User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/22.1 (windows-nt) Cancel-Lock: sha1:rjhNtf9cTEqGlobxg66NcjplicU= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@flashnewsgroups.com Organization: FlashNewsgroups.com X-Trace: 91c56483809e3e05e48ed21727 Xref: g2news1.google.com comp.lang.ada:322 Date: 2008-05-24T08:48:40-04:00 List-Id: "Dmitry A. Kazakov" writes: > Recently I ran into the following problem with generic packages. Consider > > type T is tagged null record; > > and a generic package that uses it: > > generic > type Some_T is new T with private; > package P is > ... > private > ... > end P; > > Let there be some type S derived from T: > > type S is new T with null record; > > Now the question is, how to derive another package Q from P, specialized > for S, while keeping access to the private part of P? > Factor out the types and operations currently in the private part of P into a helper child package P.Ops. Access those operations from Q: 4. New package with P.Ops; generic type Some_S is new S with private; package Q is private -- Got access to P.Ops, and have specialization end P; How would you do this in some other language? -- -- Stephe