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.3 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 22:21:04 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!news.tele.dk!small.news.tele.dk!213.56.195.71!fr.usenet-edu.net!usenet-edu.net!enst!enst.fr!not-for-mail From: Christoph Grein Newsgroups: comp.lang.ada Subject: Re: Refactoring and Ada Date: Wed, 20 Feb 2002 07:19:41 +0100 (MET) Organization: ENST, France Sender: comp.lang.ada-admin@ada.eu.org Message-ID: Reply-To: comp.lang.ada@ada.eu.org NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii X-Trace: avanie.enst.fr 1014186062 67496 137.194.161.2 (20 Feb 2002 06:21:02 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Wed, 20 Feb 2002 06:21:02 +0000 (UTC) Return-Path: Content-MD5: yc6eC/TCAg4dF0WgaFz8Dw== X-Mailer: dtmail 1.2.1 CDE Version 1.2.1 SunOS 5.6 sun4u sparc Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.0.8 Precedence: bulk X-Reply-To: Christoph Grein List-Help: List-Post: List-Subscribe: , List-Id: comp.lang.ada mail<->news gateway List-Unsubscribe: , Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org Xref: archiver1.google.com comp.lang.ada:20160 Date: 2002-02-20T07:19:41+01:00 > > 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. I've got the AARM with COR.1:2000 in front of me. There are no changes in 13.9, 13.9.1, 13.9.2. Thus a compiler failing to handle the above correctly has always been buggy. Note that 'Valid exists for scalar objects only.