From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 22 Apr 92 21:02:31 GMT From: eachus@mitre-bedford.arpa (Robert I. Eachus) Subject: Re: loop indices Message-ID: List-Id: 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: 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...