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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7bf4308ff88deca8 X-Google-Attributes: gid103376,public From: dewar@merv.cs.nyu.edu (Robert Dewar) Subject: Re: How I declare a 'mod' type within a record? Date: 1997/07/31 Message-ID: #1/1 X-Deja-AN: 261117256 References: <33DF3FD2.20D2@mail.connect.usq.edu.au> Organization: New York University Newsgroups: comp.lang.ada Date: 1997-07-31T00:00:00+00:00 List-Id: Matthew says <> I am sure GNAT does not "have fits", but rather simply diagnoses your obviously illegal code which bears no relation at all to legal Ada syntax, with a clear message. I get: 1. procedure Aging is 2. 3. type Number is new Float; 4. type Buffer is array(Integer range <>) of Number; 5. type Time_Series(Size : Integer) is 6. record 7. History : Buffer(0..Size-1); 8. Head : mod Size; | >>> subtype indication expected 9. end record; 10. 11. X : Time_Series(3); 12. 13. begin 14. null; 15. end; And of course mod Size is not a subtype indication, or even close to one. Modular types in Ada require that the modulus be a static expression. This rule is quite clear in the reference manual. You need to study modular types more carefully. When you do, you will see that they are not particularly relevant to what you are trying to do here. Records in Ada never allow anonymous types in any case, it is not clear where you got the idea that they do, certainly you never saw any examples like this. You might want to get a textbook with some clear examples if reading the rules without examples is hard.