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.3 required=5.0 tests=BAYES_00,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: dennison@telepath.com Subject: Re: Can I have an array of variant records? Date: 1999/04/22 Message-ID: <7fndrd$ijp$1@nnrp1.dejanews.com>#1/1 X-Deja-AN: 469562261 References: <371c84fb.0@silver.truman.edu> <87aew3j899.fsf@bglbv.my-dejanews.com> <7fk8c6$mbe$1@nnrp1.dejanews.com> <87k8v5oazn.fsf@bglbv.my-dejanews.com> X-Http-Proxy: 1.0 x13.dejanews.com:80 (Squid/1.1.22) for client 204.48.27.130 Organization: Deja News - The Leader in Internet Discussion X-Article-Creation-Date: Thu Apr 22 15:05:22 1999 GMT Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.5 [en] (WinNT; I) Date: 1999-04-22T00:00:00+00:00 List-Id: In article <87k8v5oazn.fsf@bglbv.my-dejanews.com>, bglbv@my-dejanews.com wrote: > Robert Dewar writes: > > > 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. Very perceptive of you. Yes, I have seen people get STORAGE_ERROR at runtime (in Ada 83) for that exact reason. Some compilers are even smart enough to point this out to you. -- T.E.D. -----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own