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)
From: Wolfgang Kilian <see...@domain.invalid>
Subject: Re: Overridability of inaccessible bindings and accessibility of
Date: Mon, 01 Oct 2012 14:43:48 +0200
Organization: A noiseless patient Spider
References: <5DS8s.1586$Wo3.firstname.lastname@example.org> <email@example.com> <firstname.lastname@example.org>
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:22.214.171.124) Gecko/20110221 SUSE/3.1.8 Thunderbird/3.1.8
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
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 126.96.36.199 - 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
> PROCEDURE(parent_op), DEFERRED, PRIVATE :: op_binding
> GENERIC :: OPERATOR(.Op.) => op_binding
> END TYPE
> ! elsewhere...
> TYPE, EXTENDS(Parent), PUBLIC :: Extension
> 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.)