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.2 required=5.0 tests=BAYES_00,FROM_DOMAIN_NOVOWEL, 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!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 List-Id: 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