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,83d7c4caadb45100 X-Google-Attributes: gid103376,public From: dewar@cs.nyu.edu (Robert Dewar) Subject: Re: DECAda/VMS - calling GETJPI Date: 1996/06/04 Message-ID: #1/1 X-Deja-AN: 158491262 references: <31B2AF74.668E@dial.eunet.ch> <4p183b$2vs@linus.mitre.org> <4p1v56$214@linus.mitre.org> organization: Courant Institute of Mathematical Sciences newsgroups: comp.lang.ada Date: 1996-06-04T00:00:00+00:00 List-Id: Mike said "Six of the quotes came from the Rationale, three of the quotes came from the RM, and there is no contradiction between the six and the three. The gnat interpretation is an inefficient interpretation because it requires extra checks and extra consternation on the part of maintenance and development programmers. The gnat interpretation is an incorrect interpretation because it does not comply with the Reference Manual 3.5.4(19) requiring reduction modulo the modulus; it does not comply with the Reference Manual 3.5.4(1) requiring ALL arithmetic to be modulo the modulus (including type casting); it does not comply with Reference Manual 4.6(30) requiring type conversion to go to the same mathematical integer, which according to Reference Manual 3.5.4(1) is modulo the modulus." 3.5.4(19) is about predefined opertors, conversion is not a predefined opertor, so this paragraph is irrelevant to the discussion and does not apply. 3.5.1(1) talks about arithmetic being modular, conversion is not an arithmetic operation in the RM sense, so this paragraph is irrelevant to the discussion. Mike your reading is just wrong, sorry. You seem to be tenaciously holding on to it, but it is unsupportable. Note in particular that the idea that -1 and 255 (or whatever) are the same mathematical integer is particularly bizarre. The sentence you call a typographical error is not a typographical error at all. The sentence in question: 28 For the evaluation of a type_conversion that is a value conversion, the operand is evaluated, and then the value of the operand is converted to a corresponding value of the target type, if any. If there is no value of the target type that corresponds to the operand value, Constraint_Error is raised; this can only happen on conversion to a modular type, and only when the operand value is outside the base range of the modular type. Additional rules follow: ONly applies to modular types, since it is only modular types where the set of values is limited. The conceptual set of values for signed integer types includes the full set of integers (of course subsequently a constraint error may occur from violating a constraint on the type. For example: x : integer := integer (999999999999999999999999); raises a constraint error, not because of anything in paragraph 28, but because the resulting value violates the constraint on integer. On the other hand x : integer'base := integer'base (9999999999999999999999999999); may not necessarily raise CE, since no constraint check is required since Integer'Base is an unconstrained type. For modular types however, the set of values includes the full set of values in the base type (e.g. 0,1,2,3 for mod 4) but no other values. So this is not a typographical error, though I can see with your style of "wishful reading" you would hope that it was one! To repeat again, GNAT is correct, Mike's interpretatoin of the RM (aided and abetted by some obsolete errors in the Rationale) is wrong. The RM is not an easy document to read, and chapter 3 especially has to be read very carefully without any sloppiness in terminology.