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=-0.3 required=5.0 tests=BAYES_00,HK_RANDOM_FROM, INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,48bf593f723b7524 X-Google-Attributes: gid103376,public From: bglbv@my-dejanews.com Subject: Re: Can I have an array of variant records? Date: 1999/04/21 Message-ID: <87k8v5oazn.fsf@bglbv.my-dejanews.com>#1/1 X-Deja-AN: 469310718 References: <371c84fb.0@silver.truman.edu> <87aew3j899.fsf@bglbv.my-dejanews.com> <7fk8c6$mbe$1@nnrp1.dejanews.com> X-Complaints-To: abuse@freeuk.net X-Trace: nnrp2.clara.net 924734589 212.126.148.33 (Wed, 21 Apr 1999 23:43:09 BST) NNTP-Posting-Date: Wed, 21 Apr 1999 23:43:09 BST Newsgroups: comp.lang.ada Date: 1999-04-21T00:00:00+00:00 List-Id: Robert Dewar writes: > < question with a no, instead of a yes>> Thank you for the correction. (As a perhaps feeble defense, I'll point out that my answer was "not that I can see", which is a rather tentative form of "no".) > To expand on my previous short message. Just declare the > type with a default discriminant. In this case you can > freely alter the discriminant value later on, and such > types compose freely (although some old compilers, notably > the Alsys Ada 83 compiler had rather severe size > limitations on the composition of such types). > > Of course typical compilers will allocate the maximum space > for each element, so if this is not acceptable, you will > indeed need to use pointers. Aha. So it isn't enough _in practice_ to give the discriminant a default value: one also needs to pick its subtype carefully. How big is Positive'Last on a typical implementation, I wonder? (>= 32767, I know.) Still, this looks cleaner than my Bounded_String suggestion.