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, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,657568723e59e45b X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,UTF8 Received: by 10.181.12.101 with SMTP id ep5mr1345227wid.1.1351391175433; Sat, 27 Oct 2012 19:26:15 -0700 (PDT) Path: q13ni70622wii.0!nntp.google.com!feeder1.cambriumusenet.nl!feed.tweaknews.nl!193.141.40.65.MISMATCH!npeer.de.kpn-eurorings.net!npeer-ng0.de.kpn-eurorings.net!border2.nntp.ams2.giganews.com!border1.nntp.ams2.giganews.com!border3.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!news.panservice.it!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Basic issue with dotted notation and tagged types Date: Mon, 22 Oct 2012 10:02:16 +0200 Organization: cbb software GmbH Message-ID: <1iwm9zh3ctl5y$.197u4rcmyrxyh$.dlg@40tude.net> References: Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: FbOMkhMtVLVmu7IwBnt1tw.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Date: 2012-10-22T10:02:16+02:00 List-Id: On Mon, 22 Oct 2012 09:46:49 +0200, J-P. Rosen wrote: > Le 22/10/2012 00:55, Yannick Duchêne (Hibou57) a écrit : >> [Snip] >> Will this display `A` or `B`? Actually, the program compiled with GNAT >> 4.6, displays `A`. It displays the same even when the two commented >> lines are commented‑out and thus the function `F` is declared before the >> field `F`. I can't remember if the RM have special wordings about it, >> but I feel this does not honour the principle of least surprise. May be >> this should be disallowed, to access any one of the two, when both are >> together visible from a scope? >> > RM2005 4.1.3 (9.2/2): "The designator of the subprogram shall not be the > same as that of a component of the tagged type visible at the point of > the selected_component." > > BTW, this corresponds to /my/ view of least surprise: a prefixed view is > merely a writing simplification, and you are always free not to use it > without losing any functionality. OTOH, you would have no other way to > access a subcomponent. Therefore, it makes sense that the subcomponent > is "stronger". >From a wider (and simpler) point of view a record component is just a pair of primitive operations (getter/setter) on the record type. That makes them conflicting with any user-defined primitive operations of same signature. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de