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: 23 Sep 91 16:44:46 GMT From: cis.ohio-state.edu!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplc en!ddsdx2.jhuapl.edu!gralia@ucbvax.Berkeley.EDU (Mars J. Gralia) Subject: Untyped "constant"? Message-ID: <1991Sep23.164446.13412@aplcen.apl.jhu.edu> List-Id: I have a question about Ada. It has to do with "named numbers" and their subsequent use. a) Suppose I have a compiler/RTE in which integer'last is 32_767. b) And suppose the system has a long_integer type in which long_integer'last = 2_147_483_647. c) And suppose I have the program: procedure Named1 is X : constant := integer'last+5; begin for j in 1..X loop null; end loop; end Named1; d) Finally, suppose the "loop" variables are really used. E.g., by disabling optimization when I invoke the compiler. Then: is this a legal program or not? Thanks, Mars Gralia DISCUSSION Some compilers, admittedly archaic or for very small computers, will raise a Constraint_Error, thereby forcing me to say: X : constant long_integer := integer'last+5; I would prefer the program given above, because it would appear to be more portable.