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.7 required=5.0 tests=BAYES_00,INVALID_DATE, MSGID_SHORT,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!ucsd!orion.cf.uci.edu!oberon!sm.unisys.com!dim!steve From: steve@dim.sm.unisys.com (Steven Holtsberg) Newsgroups: comp.lang.ada Subject: Re: Implicit conversion? Keywords: 11.6 Message-ID: <5737@sdcrdcf.sm.unisys.com> Date: 13 Mar 89 22:31:53 GMT References: <5678@sdcrdcf.sm.unisys.com> <46125@linus.UUCP> Sender: news@sm.unisys.com Reply-To: steve@sm.unisys.com (Steven Holtsberg) Organization: Unisys Santa Monica List-Id: In article <46125@linus.UUCP> eachus@mbunix.mitre.org (Robert I. Eachus) writes: >>procedure example is >> x: tiny_integer; >>begin >> x:= MAX_INT - MAX_INT; >>end example; | | ... there is an implicit conversion of MAX_INT to tiny_integer. | | ... but it is not converting the result to zero, it is using | the "-" operator for tiny_integer and doing the conversion first. | This is legal, and must be legal, on all implementations. However, | it may raise an exception during execution. The reason Verdix | doesn't raise CONSTRAINT_ERROR or NUMERIC_ERROR is more subtile. I do not see how MAX_INT, (2147483647 in this implementation) can be converted to TINY_INTEGER (-128 .. 127). I believe that the "-" operator for TINY_INTEGER is doing what 11.6(6) allows it to do, that is, "...use the operation of a type that has a range wider that that of the base type of the operands..." | In 11.6(3) (but read | all of 11.6) "...freedom is left to an implementation for reordering | actions...that are...basic operations other than assignments. This | freedom is left, as defined below, even where the execution...may | propagate a predefined exception." I don't understand what freedom to reorder actions has to do with this example.