From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 16 Sep 93 16:25:05 GMT From: cis.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!howland. reston.ans.net!spool.mu.edu!olivea!pagesat!news.cerf.net!shrike.irvine.com!adam @ucbvax.Berkeley.EDU (Adam Beneschan) Subject: Re: Don't we already have a 'Valid? (was Re: Unchecked_Conversion...) Message-ID: List-Id: In article ncohen@watson.ibm.com (Norman H. Cohen) writes: > [deleted] > 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.) I agree, this would be preferable in cases where Unchecked_Conversion is used. 'Valid would still be necessary, however, to test in cases where invalid values may be produced by other means. (Section 13.10.1 of the Ada 9X Draft Version 3.0 lists these cases; IMHO the most important are input from a file and interfacing to another language.) -- Adam