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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no 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 20:17:05 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!headwall.stanford.edu!hub1.nntpserver.com!newsfeed2.earthlink.net!newsfeed.earthlink.net!newsfeed0.news.atl.earthlink.net!news.atl.earthlink.net!news.mindspring.net!not-for-mail From: Richard Riehle Newsgroups: comp.lang.ada Subject: Re: Refactoring and Ada Date: Tue, 19 Feb 2002 20:23:27 -0800 Organization: AdaWorks Software Engineering Message-ID: <3C7324BF.996E182B@adaworks.com> References: <3C5AB0B7.9D75D49A@grammatech.com> <3c639940@pull.gecm.com> <4519e058.0202080714.1bf916bb@posting.google.com> <3C65BFF4.F15A07D0@earthlink.net> Reply-To: richard@adaworks.com NNTP-Posting-Host: 9e.fc.cc.99 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Server-Date: 20 Feb 2002 04:16:14 GMT X-Mailer: Mozilla 4.7 [en] (Win98; I) X-Accept-Language: en Xref: archiver1.google.com comp.lang.ada:20158 Date: 2002-02-20T04:16:14+00:00 List-Id: 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. Richard Riehle