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 10:02:16 PST Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!priapus.visi.com!orange.octanews.net!news-out.visi.com!petbe.visi.com!news.octanews.net!proxad.net!freenix!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 18:52:56 +0100 Organization: Adalog Message-ID: References: <_U71c.51050$mU6.207186@newsb.telia.net> <7bm1c.51092$mU6.207520@newsb.telia.net> NNTP-Posting-Host: mailhost.axlog.fr X-Trace: s1.read.news.oleane.net 1078336936 32424 195.25.228.57 (3 Mar 2004 18:02:16 GMT) X-Complaints-To: abuse@oleane.net NNTP-Posting-Date: Wed, 3 Mar 2004 18:02:16 +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:6035 Date: 2004-03-03T18:52:56+01:00 List-Id: "Bj�rn Persson" a �crit dans le message de news:7bm1c.51092$mU6.207520@newsb.telia.net... >Jean-Pierre Rosen wrote: >> 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. > >That's perfectly reasonable, but now consider this declaration: > > V : Parameter_Definition := (Str, > To_Bounded_String("A"), > To_Unbounded_String("x"); > >Here the discriminant is initialized, so with your reasoning it >shouldn't matter whether there was a default value or not. No, the important issue is how you declare the variable, initial values are irrelevant. If you declare a variable with a discriminant constraint, it is constrained. If you declare a variable without a discriminant constraint, it is unconstrained. The only thing that could be allowed would be to declare unconstrained variables for types without default values for discriminants only if they are explicitely initialized. I guess it was thought simpler to just require default values. -- --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Visit Adalog's web site at http://www.adalog.fr