From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: Discriminant and type extensions
Date: Mon, 05 Oct 2009 16:42:13 -0400
Date: 2009-10-05T16:42:13-04:00 [thread overview]
Message-ID: <wccljjp609m.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: 2b205c63-55e7-4cef-95d2-5b0ece0b8866@p9g2000vbl.googlegroups.com
"Hibou57 (Yannick Duch�ne)" <yannick_duchene@yahoo.fr> 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
next prev parent reply other threads:[~2009-10-05 20:42 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-05 17:18 Discriminant and type extensions Hibou57 (Yannick Duchêne)
2009-10-05 20:42 ` Robert A Duff [this message]
2009-10-05 22:04 ` Adam Beneschan
2009-10-05 22:29 ` Yannick Duchêne Hibou57
2009-10-05 22:34 ` Yannick Duchêne Hibou57
2009-10-05 23:08 ` Adam Beneschan
2009-10-07 6:20 ` Yannick Duchêne Hibou57
2009-10-05 22:15 ` Yannick Duchêne Hibou57
2009-10-09 6:29 ` Yannick Duchêne Hibou57
2009-10-09 15:42 ` Jean-Pierre Rosen
2009-10-07 7:21 ` Jean-Pierre Rosen
2009-10-07 15:39 ` Yannick Duchêne Hibou57
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox