TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy


Options: Use Classic View

Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Topic: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Lionel Draghi <[log in to unmask]>
Sun, 4 Mar 2001 00:20:57 +0100
text/plain (20 lines)
"Taylor, Bill - UK" wrote:
> John
> You could always look at the value of Control_Data.Month'Valid to check that
> Unchecked_Conversion has yielded a valid value. The attribute was added in
> Ada95 precisely becuase you couldn't rely on compilers to perform a range
> check. If they did, then the Unchecked_Conversion wouldn't be "unchecked".
Applying the 'Valid attribute on each record component could be really
tedious : a 'Valid on a record is the solution to get an easy
"Checked_Conversion" generic.
Last time i went on this argument, i had no answer. Provided that 'Valid
apply to each component, it's easy to implement for compilers, or am i
The compiler could also easily optimized the check on component that
can't be invalid.

Lionel Draghi.