Sun, 4 Mar 2001 09:42:32 -0500
One issue is that 'Valid is not easily implementable on
components that are of an access type. This is one of the
reasons we didn't provide a composable 'Valid attribute.
And of course for a private type, the validity conditions are
typically user-defined. There are also types that might have implicit
components, such as types with nested dynamic-sized arrays or records.
Nevertheless it would be possible to define a composable 'Valid
but there would have to be several caveats. The alternative,
presuming there are not a lot of unchecked conversion instantiations in a
given program, is to make the target object aliased, and then pass
the 'Access of it to a user-written subprogram to do a user-defined
Sometimes rather than building something in to
the language, we concluded it was a "programming problem" and it
was better to provide the "building blocks" to allow the programmer
to solve it, rather than trying to provide the end-all and be-all
In this case, it might have been better to provide some kind of
composable 'Valid, though I am not sure. In any case, presuming
your program is not rife with Unchecked_Conversions, you can probably
do what needs to be done yourself, albeit with more effort during
development and maintenance.
-Tucker Taft [log in to unmask]