From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,9ae5f4553aae9277 X-Google-Attributes: gid103376,public From: Gene Ouye Subject: Re: What's wrong with this syntax? Date: 1996/12/15 Message-ID: <32B49811.4C8@acm.org>#1/1 X-Deja-AN: 204313414 references: <32A6FE0F.7902@lmtas.lmco.com> <587aul$hrd@zeus.orl.mmc.com> content-type: text/plain; charset=us-ascii organization: Rational Software Corporation mime-version: 1.0 reply-to: geneo@acm.org newsgroups: comp.lang.ada x-mailer: Mozilla 3.0 (Win95; I) Date: 1996-12-15T00:00:00+00:00 List-Id: I've been away from CLA for a while, so I don't know if this has already been answered, but John Gluth wanted to know why: Some_Limit : Constant := 1024; ... for i in 1..(Some_Limit - 2) loop wouldn't compile in Rational Apex. I'm not sure which version of Rational Apex is being used, but it compiles fine with Apex version 2.2.0 in an Ada 95 view. In an Ada 83 view, the error message is: "(Some_Limit - 2) must be a numeric literal, named number, or attribute since both bounds of its enclosing range are of type universal integer and a conversion to INTEGER will only take place in this case [RM_83 3.6.1(2)]" This message is almost a direct quote from the 83 LRM. The "(Some_Limit - 2)" is not a numeric literal, nor is it a named number, nor is it an attribute. If it were, the conversion to Integer would take place. This is similar to "for i in -5 .. 5 loop" which is illegal because -5 is not a numeric literal... In other words, it's valid Ada 95 code, and it compiles fine as such. It's invalid Adaa 83 code, thus it's rejected. Gene Ouye