comp.lang.ada
 help / color / mirror / Atom feed
From: Jeffrey Carter <spam.jrcarter.not@spam.not.acm.org>
Subject: Re: Unknown discriminants with nested records
Date: Thu, 16 Jun 2011 23:03:37 -0700
Date: 2011-06-16T23:03:37-07:00	[thread overview]
Message-ID: <itethj$qif$1@tornado.tornevall.net> (raw)
In-Reply-To: <e3d8de4a-b442-4494-abef-4fe6c3eb7094@r27g2000prr.googlegroups.com>

On 06/16/2011 05:39 PM, Adam Beneschan wrote:
>
> The (<>) was intended to define types with unknown discriminants;

I thought it was initially created to fix the problem with generics, where in 
Ada 83 you could have

generic -- G
    type T is limited private;
    ...
package G is
    ...
end G;

package body G is
    ...
    V : T;
    ...
end G;

package I is new G (T => String, ...);

and it wasn't caught when you would like it. In Ada 95 and later, you have to 
have (<>) on the formal to have an indefinite actual, and the generic cannot 
have an uninitialized object of the type; without (<>), the actual must be 
definite; and the problem is caught when compiling the instantiation.

-- 
Jeff Carter
"Many times we're given rhymes that are quite unsingable."
Monty Python and the Holy Grail
57



      parent reply	other threads:[~2011-06-17  6:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-16 23:53 Unknown discriminants with nested records Simon Belmont
2011-06-17  0:39 ` Adam Beneschan
2011-06-17  1:48   ` Simon Belmont
2011-06-17 14:50     ` Robert A Duff
2011-06-18  8:33       ` Yannick Duchêne (Hibou57)
2011-06-20 16:16         ` Adam Beneschan
2011-06-17  6:03   ` Jeffrey Carter [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox