comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@cs.nyu.edu (Robert Dewar)
Subject: Re: DECAda/VMS - calling GETJPI
Date: 1996/06/04
Date: 1996-06-04T00:00:00+00:00	[thread overview]
Message-ID: <dewar.833923614@schonberg> (raw)
In-Reply-To: 4p1v56$214@linus.mitre.org


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.






  reply	other threads:[~1996-06-04  0:00 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-06-03  0:00 DECAda/VMS - calling GETJPI Alan Paterson
1996-06-03  0:00 ` Ken Garlington
1996-06-03  0:00 ` Mats Weber
1996-06-03  0:00 ` Stuart Palin
1996-06-03  0:00   ` Michael F Brenner
1996-06-03  0:00     ` Robert Dewar
1996-06-04  0:00       ` Michael F Brenner
1996-06-04  0:00         ` Robert Dewar
1996-06-04  0:00           ` Michael F Brenner
1996-06-04  0:00             ` Robert Dewar [this message]
1996-06-04  0:00             ` Robert Dewar
1996-06-05  0:00               ` Robert A Duff
1996-06-05  0:00                 ` Robert Dewar
1996-06-05  0:00               ` Fergus Henderson
1996-06-05  0:00                 ` Robert A Duff
1996-06-05  0:00               ` Wraparound on modular conversion (was: DECAda/VMS - calling GETJPI) Tucker Taft
1996-06-05  0:00                 ` Robert Dewar
1996-06-05  0:00             ` DECAda/VMS - calling GETJPI Adam Beneschan
1996-06-07  0:00               ` Norman H. Cohen
1996-06-11  0:00                 ` Adam Beneschan
1996-06-04  0:00       ` Ken Garlington
1996-06-06  0:00         ` Robert Dewar
  -- strict thread matches above, loose matches on Subject: below --
1996-06-06  0:00 George Haddad
1996-06-07  0:00 ` Robert Dewar
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox