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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,4cad17e8664256c9 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!f19g2000yqo.googlegroups.com!not-for-mail From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: Re: Allocation questions Date: Thu, 28 May 2009 05:19:31 -0700 (PDT) Organization: http://groups.google.com Message-ID: <96a89bf4-4968-45fb-aa5b-4a47f2e06045@f19g2000yqo.googlegroups.com> References: <4a1e5d9e$0$2868$ba620e4c@news.skynet.be> NNTP-Posting-Host: 153.98.68.197 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1243513172 17502 127.0.0.1 (28 May 2009 12:19:32 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 28 May 2009 12:19:32 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: f19g2000yqo.googlegroups.com; posting-host=153.98.68.197; posting-account=pcLQNgkAAAD9TrXkhkIgiY6-MDtJjIlC User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10,gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:6067 Date: 2009-05-28T05:19:31-07:00 List-Id: xavier grave: > > Or you could use a discriminant: > > > =A0 =A0type Samples (No_Of_Samples : Natural :=3D 0) is > > =A0 =A0 =A0 record > > =A0 =A0 =A0 =A0 =A0S : array (1 .. No_Of_Samples) of Sample; > > =A0 =A0 =A0 end record; > > My two cents about variant discriminant : IMHO one should avoid to > declare No_Of_Samples as Natural and with a default value, because as > far as I remember some compilers will book for S (1 .. Natural'Last) of > Sample which can be a lot... > > May be some compiler guru can confirm or infirm this ? I confirm this with GNAT even though I'm no guru. Well spotted, Xavier. -- Ludovic Brenta.