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.6 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM,FROM_LOCAL_NOVOWEL,HK_RANDOM_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,f5e42181cacdac63 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!x37g2000yqj.googlegroups.com!not-for-mail From: vldmr Newsgroups: comp.lang.ada Subject: Re: Variant record assignment fails discriminant check Date: Wed, 2 Sep 2009 09:09:49 -0700 (PDT) Organization: http://groups.google.com Message-ID: <8c7997fc-1696-42a4-a11a-847f279fc2f1@x37g2000yqj.googlegroups.com> References: <577dcd1b-5384-408f-abf5-440e6ebd651a@a7g2000yqo.googlegroups.com> <7614be09-c46f-44f8-a04b-090af7c1bf13@k13g2000prh.googlegroups.com> <2e307dac-ae36-46a3-813f-09271215cca3@o9g2000yqj.googlegroups.com> NNTP-Posting-Host: 205.175.225.24 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1251907790 9774 127.0.0.1 (2 Sep 2009 16:09:50 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 2 Sep 2009 16:09:50 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: x37g2000yqj.googlegroups.com; posting-host=205.175.225.24; posting-account=e5APRAkAAAA7e6WNQ_sgu3KZK7Pj5eew User-Agent: G2/1.0 X-HTTP-Via: 1.1 secproxy04.rockwellcollins.com:8080 (IWSS) X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.11) Gecko/2009061208 Iceweasel/3.0.6 (Debian-3.0.6-1),gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:8114 Date: 2009-09-02T09:09:49-07:00 List-Id: On Sep 2, 10:33=A0am, Adam Beneschan wrote: > However, you can get around this by embedding the variant record > inside another record: > > =A0 =A0type Rec is record > =A0 =A0 =A0 Name : t_X520CommonName; > =A0 =A0end record; > =A0 =A0type Acc_Rec is access all Rec; > > Now, if X has type Acc_Rec, you can pass X.Name to your procedure, and > it will be unconstrained (and therefore mutable). > > This is a workaround that I've used extensively in my own code, by the > way. > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 -- Adam Yup, that works. I can not say I quite understand why, so for sure I would not be able to invent that by myself. Thank you very much! Vladimir