From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,4c459ff0adb576bc X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-02-19 21:20:02 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.cwix.com!wn2feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi.com!sccrnsc02.POSTED!not-for-mail Message-ID: <3C7331D0.32E9EF09@attbi.com> From: Mark Biggar X-Mailer: Mozilla 4.79 [en]C-{C-UDP; EBM-SONY1} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Refactoring and Ada References: <3C5AB0B7.9D75D49A@grammatech.com> <3c639940@pull.gecm.com> <4519e058.0202080714.1bf916bb@posting.google.com> <3C65BFF4.F15A07D0@earthlink.net> <3C7324BF.996E182B@adaworks.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 12.234.195.83 X-Complaints-To: abuse@attbi.com X-Trace: sccrnsc02 1014182400 12.234.195.83 (Wed, 20 Feb 2002 05:20:00 GMT) NNTP-Posting-Date: Wed, 20 Feb 2002 05:20:00 GMT Organization: AT&T Broadband Date: Wed, 20 Feb 2002 05:20:00 GMT Xref: archiver1.google.com comp.lang.ada:20159 Date: 2002-02-20T05:20:00+00:00 List-Id: Richard Riehle wrote: > > Larry Kilgallen wrote: > > > > What happens when you read junk off the interface? > > > > Doesn't 'Valid detect that ? > > It turns out that 'Valid is not as useful as many of us thought it was. For > example, the result of an erroneous result from unchecked conversion, > which we originally thought was harmless if we checked it ourselves > with 'Valid before using it is a problem. Consider the following, > > type X is ... ; > type Y is ... ; > > function Convert is new Ada.Unchecked_Conversion > (Source => Y, Target => X); > > X := Convert (Y); -- suppose X is erroneous or not valid > if X'Valid then ... -- We used to think this was OK. > -- Some compilers fail on this because of an > interpretation > -- of the ALRM rules. > > At present, one must wonder about the usefulness of 'Valid. There is an AI with a binding interpretation that was included in the TC that says that at least for scalar types the above code is not errorious and must work as expected. SO any compiler that fail on the above are non-compliant. -- Mark Biggar mark.a.biggar@attbi.com