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,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,45a9122ddf5fcf5 X-Google-Attributes: gid103376,public From: kilgallen@eisner.decus.org (Larry Kilgallen) Subject: Re: Rules for Representation of Subtypes Date: 1996/09/29 Message-ID: <1996Sep29.082143.1@eisner>#1/1 X-Deja-AN: 186019243 x-nntp-posting-host: eisner.decus.org references: <1996Sep26.191257.1@eisner> <1996Sep28.155354.1@eisner> x-nntp-posting-user: KILGALLEN x-trace: 843999725/28514 organization: LJK Software newsgroups: comp.lang.ada Date: 1996-09-29T00:00:00+00:00 List-Id: In article , bobduff@world.std.com (Robert A Duff) writes: > In article <1996Sep28.155354.1@eisner>, > Larry Kilgallen wrote: >>If the assignment of the output causes erroneousness, >>then why isn't the name of the operation Checked Conversion ? > > Heh? If it were checked, it would do something sensible, like raise an > exception, or return a well-defined result, or give a compile-time > error. The UNchecked means, it's *not* checked -- if you do something > wrong, you get unpredictable behavior, i.e. erroneous execution. But my X'valid should still work. And compilers are not allowed to change the flow of a program. X := my_unchecked_conversion(Y); if X'valid then Z(247) := X; else raise my_exception; end if; No optimizer should stash my X into Z until it determines the result of my conditional. Likewise for: X:= my_unchecked_conversion(Y); if not X'valid then raise my_exception; end if; Z(247) := X; no optimizer should stash my X into Z until it knows the result of the possible flow control change represented by raise my_exception. Larry Kilgallen