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.7 required=5.0 tests=BAYES_00,INVALID_DATE, MSGID_SHORT,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!mcvax!dik From: dik@cwi.nl (Dik T. Winter) Newsgroups: comp.lang.ada Subject: Re: Question about discrimiants Message-ID: <358@zuring.cwi.nl> Date: Tue, 7-Jul-87 19:28:01 EDT Article-I.D.: zuring.358 Posted: Tue Jul 7 19:28:01 1987 Date-Received: Sat, 11-Jul-87 01:25:17 EDT References: <2079@enea.UUCP> Reply-To: dik@zuring.UUCP (Dik T. Winter) Organization: CWI, Amsterdam List-Id: In article <2079@enea.UUCP> sommar@enea.UUCP(Erland Sommarskog) writes: > > The following declaration is incorrect (LRM 3.7.1(6)): > > TYPE Nisse(Size : integer_type) IS > RECORD > A : Array(1..Size) of integer; > B : Array(1..2*Size) of integer; > END; > > Does anyone know why? I can understand forbidding a dynamic expression, > but a static? (It would perhaps be better if programs posted to the net where at least syntactically correct in order to reduce the number of messages pointing to syntactic errors. The following comments refer to this part after making it syntactically correct.) Yes, 3.7.1(6) explicitly states that discriminants may be used in subtype definitions (as is done here), but in that case cannot be used in larger expressions. Anyhow, you appear to understand forbidding dynamic expressions, can you elaborate? At least, the context here is dynamic and non-static (a discriminant is never static). I think the designers wanted to avoid the need for a system to produce run-time routines for many declarations (as in Algol-68), but for a full explanation we have to wait for the Rationale of course. -- dik t. winter, cwi, amsterdam, nederland INTERNET : dik@cwi.nl BITNET/EARN: dik@mcvax