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: 103376,70414f56d810c10c X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.50.133 with SMTP id c5mr578870pbo.2.1316662358234; Wed, 21 Sep 2011 20:32:38 -0700 (PDT) MIME-Version: 1.0 Path: lh7ni2276pbb.0!nntp.google.com!news1.google.com!volia.net!news2.volia.net!feed-A.news.volia.net!news.ecp.fr!news.jacob-sparre.dk!pnx.dk!jacob-sparre.dk!ada-dk.org!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: discriminant questions Date: Wed, 21 Sep 2011 22:32:33 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <9f37b726-d80b-4d24-bf3f-28a14255f7fd@s20g2000yql.googlegroups.com> <86015926-d652-4265-aedd-413312d399f9@dq7g2000vbb.googlegroups.com> <0d272f62-67d0-4905-972c-8a7e912c5531@en1g2000vbb.googlegroups.com> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1316662356 4518 69.95.181.76 (22 Sep 2011 03:32:36 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Thu, 22 Sep 2011 03:32:36 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.6109 X-RFC2646: Format=Flowed; Original Xref: news1.google.com comp.lang.ada:18077 Date: 2011-09-21T22:32:33-05:00 List-Id: "ytomino" wrote in message news:ad6f00e2-cc67-4fa3-8268-7247ebed94b0@d14g2000yqb.googlegroups.com... > Thank you for your suggestion. I'm reading AARM now... > > For the first time, I got to know the difference between "access > discriminant" and a normal discriminant having named access type. > I am surprised at that a normal discriminant having named access type > can have default and is able to assignment. > But, in RM 4.1 (5 (2/3)), "This aspect is specified by a name that > denotes an access discriminant declared for the type T."...It seems > that a normal discriminant having named access type can not be > Implicit_Dereferene... > Close! It's regrettable. > > Back to the subject, lifetime of coextension, It's interesting. > Coextension probably is one of the reason that objects with access > discriminant can never allow them to be changed. > However, I have not resulted in firm belief yet. > > As another reason, default of "access discriminant" has been used for > discriminating which a formal limited type in generic is > really(immutably) limited or non-limited since Ada 95. > "immutably limited" concept is used widely. (Therefore it is hard to > change this rule.) > > Is my understanding right...? Seems OK as far as it goes. But you have to bring accessibility into it (and the desire and in fact necessity of not having a separate accessibility level for an access discriminant). Note that the accessibility of a discriminant of a named access type is that of the named access type, while that of an anonymous access discriminant is that of the enclosing object. A big difference, and it is what we need for safe accessors. An accessor of a discriminant of a named access type would make is easy to create dangling pointers (as mentioned in the GEM), and that would be bad. Thus no implicit dereference there. > > I have not been found the reason about accessibility check yet. > I'm going to read RM 3.10.2 and AI95-00230-01 at next. You're a glutton for punishment! :-) If you figure it out, including all of the corner cases, please come to the ARG meetings and explain it to us. ;-) [I'm certain that it is still wrong in various ways.] Randy.