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,FREEMAIL_FROM, T_FILL_THIS_FORM_SHORT autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,13aaae984988cb0d X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,CP1252 Path: g2news2.google.com!postnews.google.com!s6g2000vbp.googlegroups.com!not-for-mail From: =?ISO-8859-1?Q?Yannick_Duch=EAne_Hibou57?= Newsgroups: comp.lang.ada Subject: Re: Discriminant and type extensions Date: Mon, 5 Oct 2009 15:15:14 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <2b205c63-55e7-4cef-95d2-5b0ece0b8866@p9g2000vbl.googlegroups.com> NNTP-Posting-Host: 86.66.190.90 Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1254780914 5060 127.0.0.1 (5 Oct 2009 22:15:14 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 5 Oct 2009 22:15:14 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: s6g2000vbp.googlegroups.com; posting-host=86.66.190.90; posting-account=vrfdLAoAAAAauX_3XwyXEwXCWN3A1l8D User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; fr),gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:8590 Date: 2009-10-05T15:15:14-07:00 List-Id: Hi Bob, On 5 oct, 22:42, Robert A Duff wrote: > I'm not sure exactly what you mean, but you can do things like this: An example will tell more (I've dropped any kind of genericity here) : package P1 is type T_Type (Discriminant : Natural) is tagged private; private type T_Type (Discriminant : Natural) is tagged null record; end P1; with P1; package P2 is type Extension_Type is new P1.T_Type with private; -- Extension_Type as a discriminant, but it -- does not explicitly appears in this -- package specification. private type Extension_Type is new P1.T_Type with null record; end P2; with P2; procedure Usage is Entity : P2.Extension_Type (Discriminant =3D> 0); -- Indeed, it really has a discriminant, -- although the package interface does -- not express it. begin null; end; I was thinking in this context, it may be nice to be able to express again the discriminant at the place Extension_Type is declared. To be honest, it happens too I feel it would be nice to something which would allow to recall about the underlying interface which is left implicit. Something similar to what the keyword =93 overriding =94 does. The keyword =93 overriding =94 recalls about what is the underlying stuff, making things more explicit. I was thinking about something similar. For procedures and functions, the Renames clause may do the thing (explicitly re-introducing procedures and functions in the scope), but for discriminants in this kind of context, I do not know a way. Perhaps I do not know it, or perhaps this may be a candidate proposal.