Rationale for Ada 2005
9.3.1 Aggregates for private types
notation was introduced for aggregates to mean the default value if any.
. A curiosity is that we can write
type Secret is private;
type Visible is
X: Visible := (A => 77; S => <>);
but we cannot write
S: Secret := <>; -- illegal
The argument is that this would be of little use
since the components take their default values anyway.
For uniformity AI-389
S: Secret := (others => <>);
for private types and
also for task and protected types. One advantage would be that we could
S: constant Secret := (others => <>);
whereas at the moment it is not possible to declare
a constant of a private type because we are unable to give an initial
However, discussion of this issue lead into a quagmire
concerning the related AI-413
and in the end both were abandoned.
© 2005, 2006, 2007 John Barnes Informatics.
Sponsored in part by: