comp.lang.ada
 help / color / mirror / Atom feed
From: markb@sdcrdcf.UUCP (Mark Biggar)
Subject: Re: Elaboration of Parameterised Record Types
Date: Wed, 5-Nov-86 12:33:03 EST	[thread overview]
Date: Wed Nov  5 12:33:03 1986
Message-ID: <3403@sdcrdcf.UUCP> (raw)
In-Reply-To: 386@cernvax.UUCP

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

  reply	other threads:[~1986-11-05 17:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1986-11-03 17:24 Elaboration of Parameterised Record Types paul
1986-11-05 17:33 ` Mark Biggar [this message]
1986-11-09 19:37 ` Michael Vilot
  -- strict thread matches above, loose matches on Subject: below --
1986-10-08 13:06 Elaboration of parameterised record types paul
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox