Message from discussion
Overridability of inaccessible bindings and accessibility of overriding bindings
Received: by 10.66.84.168 with SMTP id a8mr4466207paz.25.1349095429257;
Mon, 01 Oct 2012 05:43:49 -0700 (PDT)
Path: g9ni10673pbh.1!nntp.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!news2.euro.net!news.mixmin.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail
From: Wolfgang Kilian <see...@domain.invalid>
Newsgroups: comp.lang.fortran
Subject: Re: Overridability of inaccessible bindings and accessibility of
overriding bindings
Date: Mon, 01 Oct 2012 14:43:48 +0200
Organization: A noiseless patient Spider
Lines: 58
Message-ID: <k4c364$5r4$1@dont-email.me>
References: <5DS8s.1586$Wo3.691@viwinnwfe02.internal.bigpond.com> <k411c9$8n2$1@dont-email.me> <k41dci$9qs$1@dont-email.me>
Mime-Version: 1.0
Injection-Date: Mon, 1 Oct 2012 12:43:48 +0000 (UTC)
Injection-Info: mx04.eternal-september.org; posting-host="2c5cce36bb074a0b801a610298736e6a";
logging-data="5988"; mail-complaints-to="ab...@eternal-september.org"; posting-account="U2FsdGVkX18QgV2x6ibTacVBtWm+Y6RSl+T5GsL0fOw="
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.14) Gecko/20110221 SUSE/3.1.8 Thunderbird/3.1.8
In-Reply-To: <k41dci$9qs$1@dont-email.me>
Cancel-Lock: sha1:Djs3Ouajap3qhiujvkMuQ9Ym8HY=
Bytes: 3470
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
On 09/27/2012 01:30 PM, Ian Harvey wrote:
> On 2012-09-27 6:05 PM, Wolfgang Kilian wrote:
>> On 09/27/2012 08:46 AM, Ian Harvey wrote:
>>> If I have a private binding in an extensible type that is in a
>>> particular module; I extend that type in another module and in that
>>> extended type I have a binding of the same name as the private binding
>>> in the parent type, does the binding in the extension type override the
>>> binding in the parent type?
>> [...]
>> I guess this makes sense. What does the standard say here?
>>
>> -- Wolfgang
>
> (I think this is equivalent.)
>
> I get concrete type four times with gfortran 4.8x from early August and
> ifort 13.0.0.
>
> My reading of the std was that the overriding happens - accessibility
> not being mentioned as a criteria in 4.5.7.3 - the binding just has to
> have the "same binding name as a type-bound procedure".
>
> I was hoping this was the case, otherwise type bound operators become
> clunky - the specific procedures that implement them in the type where
> they are declared would otherwise need to be public, which exposes
> implementation detail. I want to do:
>
> TYPE, ABSTRACT, PUBLIC :: Parent
> CONTAINS
> PROCEDURE(parent_op), DEFERRED, PRIVATE :: op_binding
> GENERIC :: OPERATOR(.Op.) => op_binding
> END TYPE
>
> ! elsewhere...
> TYPE, EXTENDS(Parent), PUBLIC :: Extension
> CONTAINS
> PROCEDURE, PRIVATE :: op_binding => extension_op
> END TYPE
>
> For CLASS(Parent) :: obj I don't want clients to be able to directly
> reference "obj%op_binding", I want them to have to go via ".Op. obj".
I just got the response from NAG support that this issue was actually
discussed and resolved in the interpretation request F08/0052. The
answer is that the behavior of the NAG compiler is actually correct. In
my understanding: the private binding should be treated by other modules
as if it never existed. To enable overriding, it has to be made PUBLIC.
This implies that both gfortran and ifort should be modified. (Of
course, neither of them claims to implement the F2008 standard, yet.)
-- Wolfgang
--
E-mail: firstnameinitial.lastn...@domain.de
Domain: yahoo