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: a07f3367d7,13aaae984988cb0d X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!news2.google.com!news.glorb.com!guardian.oit.duke.edu!nntp-out.monmouth.com!newspeer.monmouth.com!newsswitch.lcs.mit.edu!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Discriminant and type extensions Date: Mon, 05 Oct 2009 16:42:13 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <2b205c63-55e7-4cef-95d2-5b0ece0b8866@p9g2000vbl.googlegroups.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: pcls4.std.com 1254775333 17123 192.74.137.71 (5 Oct 2009 20:42:13 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Mon, 5 Oct 2009 20:42:13 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:c/aqQlZWth4nRZoTDjsE0HV5yWE= Xref: g2news2.google.com comp.lang.ada:8588 Date: 2009-10-05T16:42:13-04:00 List-Id: "Hibou57 (Yannick Duch�ne)" writes: > I was looking at two of my generic packages, fully functionals, that > is not the trouble, but not expressive enough IMHO. > > The lack, from my point of view, is in the way a type can be extended > from a another type with discriminants. > > What I mean : I've got a type in a package, a tagged type with > discriminants. Then a second package extends this type, but the > discriminants from the extended type does not appears in the extension > declaration. When I want to instantiate the type (the extended one), I > obviously have to provide the actuals for these discriminants (the > ones coming from the type which was extended). > > What do you think about it ? > > Do you think it would be a good proposal to allow the discriminant to > be explicitly recalled in an extension declaration ? (just to be more > explicit and expressive) I'm not sure exactly what you mean, but you can do things like this: type T (D : Positive) is tagged ... type T2 (D : Positive; D2 : Boolean) is new T(D => D); type T3 is new T(D => 1_000_000); type T4 (D2 : Boolean) is new T(D => 1_000_000); - Bob