comp.lang.ada
 help / color / mirror / Atom feed
* Derived type declartion questions
@ 1994-11-03  1:37 BernhardM
  1994-11-03 14:47 ` Tucker Taft
  0 siblings, 1 reply; 2+ messages in thread
From: BernhardM @ 1994-11-03  1:37 UTC (permalink / raw)


PACKAGE numeric_base_types IS
 TYPE integers IS NEW integer;
end numeric_base_types;

WITH numeric_base_types;
PACKAGE numeric_types IS
   TYPE int30s IS NEW numeric_base_types.integers
      RANGE 0 .. 2**30-1;
END numeric_types;

Our interpretation of LRM 4.6(15) (first paragraph 15) is that the
upper bound of the above range constraint is illegal, since the
operators "**" and "-" for integers are not visible within the package
numeric_types. LRM 3.5.4(8) references LRM 4.6.

Is this a correct interpretation of the 1983 LRM ?

The June 94 Ada 9X Reference Manual 3.5 has been reworded. 3.5 (5)
states "For a range of a given type, the simple_expressions of the
range (likewise, the simple_expressions of the equivalent range for a
range_attribute_reference) are expected to be of the type of the
range."

What does "expected" mean ? Specifically, what is the action required
of a compiler if the expectation is not met ?

Furthermore, 3.5 (9) states "If simple_expressions are given to
specify bounds, the evaluation of the range evaluates these simple
expressions in an arbitrary order, and converts them to the type of
the range."

If we assume that the "simple_expressions of the range" mentioned in
3.5 (5) are the same as the "simple_expressions given to specify bounds",
then it seems to us that paragraphs 3.5 (5) and 3.5 (9) are contradictory.

This is based on the further assumption "expected" means "shall" or
"must".

What is the intended meaning of these paragraphs ?

Bruce Gayliard     rusty@tinton.ccur.com
Bernhard Mulder    bm@tinton.ccur.com



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1994-11-03 14:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1994-11-03  1:37 Derived type declartion questions BernhardM
1994-11-03 14:47 ` Tucker Taft

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