comp.lang.ada
 help / color / mirror / Atom feed
From: cis.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!howland.
Subject: Re: Don't we already have a 'Valid? (was Re: Unchecked_Conversion...)
Date: 16 Sep 93 16:25:05 GMT	[thread overview]
Message-ID: <CDGG9t.9BD@irvine.com> (raw)

In article <CDAooM.nEt@yktnews.watson.ibm.com> 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

             reply	other threads:[~1993-09-16 16:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1993-09-16 16:25 cis.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!howland. [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-13 13:41 Norman H. Cohen
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