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!attcan!uunet!lll-winken!lll-lcc!ames!mailrus!tut.cis.ohio-state.edu!rutgers!rochester!pt.cs.cmu.edu!sei!ajpo!rracine From: rracine@ajpo.sei.cmu.edu (Roger Racine) Newsgroups: comp.lang.ada Subject: Re: Implicit conversion? Message-ID: <474@ajpo.sei.cmu.edu> Date: 17 Mar 89 18:11:45 GMT References: <5678@sdcrdcf.sm.unisys.com> <57900090@ada-uts> Reply-To: rracine@ajpo.sei.cmu.edu (Roger Racine) Organization: C. S. Draper Laboratory List-Id: With respect to X := MAX_INT - MAX_INT; Why would it be necessary to convert MAX_INT to anything? There exists a predefined "-" operation which takes two universal_integers and returns universal_integer. Then one is left with X := 0; Implicit type conversion on the 0 works fine, and no errors occur. On the other hand, if the implicit type conversion did take place, I think the LRM is clear that CONSTRAINT_ERROR should occur (4.6 para 12). 4.6 para 15 states: "An implicit conversion ... is applied if and only if the innermost complete context (see 8.7) determines a unique ... target type for the implicit conversion, and there is no legal interpretation of this context without this conversion." While the innermost complete context, which is the statement, does determine a unique target type, I would maintain that there is a legal interpretation without the conversion. The subtraction can be seen as a universal expression, which is then converted. I do NOT see how one can consider the implicit conversion of MAX_INT to be an "intermediate result" of a predefined operation. I always took that phrase to mean "once the operations started, if the expression has more than one operation, NUMERIC_ERROR does not need to be raised even if one of the operations gives a result which is outside the range of the base type." Please help me understand why an implementation should be allowed to raise ANY exception.