From: eachus@mitre-bedford.arpa (Robert I. Eachus)
Subject: Re: loop indices
Date: 22 Apr 92 21:02:31 GMT [thread overview]
Message-ID: <EACHUS.92Apr22160231@Dr_No.mitre.org> (raw)
In article <1992Apr21.211509.1911@software.org> smithd@software.org (Doug Smith
) writes:
Then during an investigation encountered an interesting problem.
Guess where the following code encounters a constraint error:
<example deleted...>
No, this is not a solution--but look carefully at the variable
v3:
It is of subtype Vec which is a constrained array
with range 21..25
v3'range is 51..55.
Have I missed something? (This compiles using Verdix and Dec
Ada compilers). Any comments from the Language Lawyers?
RFTM 8.5(4) :-) ...The renamed entity must be an object of the base
type of the type mark. The properties of the renamed object are not
affected by the renaming declaration. In particular, its value and
whether or not it is a constant are unaffected; similarly, the
constraints that apply to an object are not affected by a renaming
(any constraint implied by the renaming declaration is ignored....
Surprising, true. But you really have to work at it to get bitten
by this rule. (In the more frequent case where both type marks are
the same--and unconstrained--you don't want implicit sliding of the
bounds. Having the bounds slide in some cases and not in others would
really be perverse.)
Robert I. Eachus
with STANDARD_DISCLAIMER;
use STANDARD_DISCLAIMER;
function MESSAGE (TEXT: in CLEVER_IDEAS) return BETTER_IDEAS is...
--
Robert I. Eachus
with STANDARD_DISCLAIMER;
use STANDARD_DISCLAIMER;
function MESSAGE (TEXT: in CLEVER_IDEAS) return BETTER_IDEAS is...
next reply other threads:[~1992-04-22 21:02 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
1992-04-22 21:02 Robert I. Eachus [this message]
-- strict thread matches above, loose matches on Subject: below --
1992-04-20 21:11 loop indices David A. Hasan
1992-04-20 16:39 David A. Hasan
1992-04-20 14:00 Robert Firth
1992-04-17 20:00 Mark A Biggar
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox