"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