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.1 required=5.0 tests=BAYES_00, PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,d67ca8d922a33c8a X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-03-03 02:01:59 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!nnx.oleane.net!oleane!nnrp.oleane.net!skymaster!nobody From: "Jean-Pierre Rosen" Newsgroups: comp.lang.ada Subject: Re: Heterogenous array Date: Wed, 3 Mar 2004 10:43:37 +0100 Organization: Adalog Message-ID: References: <_U71c.51050$mU6.207186@newsb.telia.net> NNTP-Posting-Host: mailhost.axlog.fr X-Trace: s1.read.news.oleane.net 1078308118 18176 195.25.228.57 (3 Mar 2004 10:01:58 GMT) X-Complaints-To: abuse@oleane.net NNTP-Posting-Date: Wed, 3 Mar 2004 10:01:58 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Xref: archiver1.google.com comp.lang.ada:6027 Date: 2004-03-03T10:43:37+01:00 List-Id: "Bj�rn Persson" a �crit dans le message de news:_U71c.51050$mU6.207186@newsb.telia.net... >Steve wrote: >> The way I look at it, the default descriminant is a way of telling the >> compiler you may want to assign a record with a different discriminant value >> to a record you have declared. That way enough memory is allocated to hold >> the largest variant. If you don't give a default descriminant, that tells >> the compiler you're going to explicitly select the variant for each record >> you declare, so it can size each variant in the smallest allocation - with >> the restriction that you cannot assign a different variant after the >> declaration. > >Okay, after some experimentation I understand the difference, but I >can't help thinking that it seems somewhat unlike Ada to say "make the >discriminant immutable in all objects of this type" by not giving it a >default value. Putting a "constant" somewhere would have been more >intuitive. Acutally, it's the other way round. What you want to do is to be able to declare an unconstrained variable, i.e.: V : Parameter_Definition; Since there is no discriminant constraint, the variable is not constrained to always have the same value of the discriminant. However, a discriminant is used by the compiler to make address computations. It would be extremely dangerous to have an uninitialized discriminant. Therefore, a declaration that does not specify discriminants is allowed only if there are default values for the discriminants. -- --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Visit Adalog's web site at http://www.adalog.fr