From: dik@cwi.nl (Dik T. Winter)
Subject: Re: Question about discrimiants
Date: Tue, 7-Jul-87 19:28:01 EDT [thread overview]
Date: Tue Jul 7 19:28:01 1987
Message-ID: <358@zuring.cwi.nl> (raw)
In-Reply-To: 2079@enea.UUCP
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
next prev parent reply other threads:[~1987-07-07 23:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
1987-07-07 10:34 Question about discrimiants Erland Sommarskog
1987-07-07 23:28 ` Dik T. Winter [this message]
1987-07-10 16:11 ` stt
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox