From: scifi!hawnews.watson.ibm.com!yktnews.watson.ibm.com!ncohen@uunet.uu.net (Norman H. Cohen)
Subject: Re: Don't we already have a 'Valid? (was Re: Unchecked_Conversion...)
Date: 13 Sep 93 13:41:10 GMT [thread overview]
Message-ID: <CDAooM.nEt@yktnews.watson.ibm.com> (raw)
Some clarifications:
1. Thanks to Ben Brosgol has pointed out to me (in private
correspondence) that I muffed the syntax of the 'Valid attribute:
It's not subtype'Valid(object), but object'Valid.
2. The tinkering I claimed was necessary concerned an assertion in the
ANNOTATED Ada 9X Reference Manual that it is a ramification of rules
in the 9X Reference Manual itself that an unchecked conversion
is erroneous if it produces an invalid value of the target type, i.e.,
that the very act of performing the unchecked conversion can render
all subsequent execution unpredictable, regardless of how that value
is used. I don't believe this is the intent of the Revision Team.
My guess is that the assertion in the ANNOTATED Reference Manual is
false, i.e., this unwanted property is NOT really a ramification of
rules in the Reference Manual. In this case the only needed tinkering
would be with the annotations describing the proposed standard, not
with the proposed standard itself.
3. Like Robert Eachus (if I understand his post correctly), I believe
that the best solution would have been an attribute like
target_subtype'Would_Be_Valid(source_object)
indicating without performing the unchecked conversion of
source_object to target_subtype whether the bits of source_object are
a valid representation of a value of target_subtype. This provides a
convenient way for the programmer to validate untrustworthy data
without ever constructing invalid values. (I'm sure there is a better
name, but Would_Be_Valid conveys my intent.)
--
Norman H. Cohen ncohen@watson.ibm.com
next reply other threads:[~1993-09-13 13:41 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
1993-09-13 13:41 Norman H. Cohen [this message]
-- strict thread matches above, loose matches on Subject: below --
1993-09-16 17:39 Don't we already have a 'Valid? (was Re: Unchecked_Conversion...) Tucker Taft
1993-09-16 16:25 cis.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!howland.
1993-09-10 20:49 Robert I. Eachus
1993-09-10 17:06 Mark A Biggar
1993-09-10 15:07 cis.ohio-state.edu!news.sei.cmu.edu!magnesium.club.cc.cmu.edu!honeydew.sr
1993-09-10 14:00 Mike Berman
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox