Article View: net.lang.ada
Article #1049Re: Elaboration of Parameterised Record Types
From: Mark Biggar
Date: Wed, 05 Nov 1986 17:33
Date: Wed, 05 Nov 1986 17:33
17 lines
1656 bytes
1656 bytes
There is a difference between a discriminant with a default value and one
without. If you define the discriminant with a default value you are
declaring that the value of the discriminant for any object can be changed
dymanically to any value in the range of the discriminants type. Thus, the
compiler must allocate enough storage to hold an object with any legal
value of the discriminant. If you don't give a default value to the
discriminant then the value may not change dynamically and must be set at
the time the object with the discriminant is declared and the compiler can
allocate just enough storage for the object. The example you sight from
the LRM does NOT define a default value for the discriminant, so each
object in the example is declared with its own fixed discriminant value,
while in your program fragment you DO define a default so the size of the
objects have to be allocated large enough to store any object of any size
and the compiler is upset about it.
Mark Biggar
{allegra,burdvax,cbosgd,hplabs,ihnp4,akgua,sdcsvax}!sdcrdcf!markb
Technical Details
Message-ID:
<3403@sdcrdcf.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!mnetor!seismo!rutgers!sri-spam!sri-unix!hplabs!sdcrdcf!markbReferences:
<386@cernvax.UUCP>Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!rutgers!sri-spam!sri-unix!hplabs!sdcrdcf!markb From: markb@sdcrdcf.UUCP (Mark Biggar) Newsgroups: net.lang.ada Subject: Re: Elaboration of Parameterised Record Types Message-ID: <3403@sdcrdcf.UUCP> Date: Wed, 5-Nov-86 12:33:03 EST Article-I.D.: sdcrdcf.3403 Posted: Wed Nov 5 12:33:03 1986 Date-Received: Wed, 5-Nov-86 23:08:14 EST References: <386@cernvax.UUCP> Reply-To: markb@sdcrdcf.UUCP (Mark Biggar) Organization: System Development Corporation R&D, Santa Monica Lines: 17