(j3.2006) About extending abstract types with deferred bindings

Van Snyder Van.Snyder
Thu Sep 8 14:26:23 EDT 2016


On Thu, 2016-09-08 at 17:28 +0900, Cohen Malcolm wrote:
> Your ancestor component *IS* an object of abstract type.

Right, but it *IS* instantiated.  We can't rely on the conjecture that
it's impossible to instantiate an object of abstract type to prevent
invoking deferred procedures bound to their types.  We need actively to
prohibit using them.  Is there a constraint that does this?  I haven't
found it yet.

> 
> -----Original Message----- 
> From: Van Snyder
> Sent: Thursday, September 8, 2016 5:22 PM
> To: j3 at mailman.j3-fortran.org
> Subject: Re: (j3.2006) About extending abstract types with deferred bindings
> 
> On Thu, 2016-09-08 at 17:15 +0900, Cohen Malcolm wrote:
> > <<<
> > Is there a prohibition against invoking an accessible deferred
> > procedure
> > binding using an abstract ancestor component of a non-abstract object?
> > >>>
> >
> > In effect.  The rules prevent instantiating an object of abstract type
> > in
> > the first place.
> 
> You don't need an object of abstract type to do this.  An ancestor
> component of abstract type, of an object of concrete type, is of
> abstract type.  The object of concrete type can be instantiated.
> 
> type, abstract :: T1
> ...
> contains
>   procedure(...), deferred :: P1
> end type T1
> 
> type, extends(t1) :: T2
> ...
> contains
>   procedure(...) :: P1
> end type T2
> 
> type(t2) :: X
> 
>   call x%t1%p1
> 
> 
> _______________________________________________
> J3 mailing list
> J3 at mailman.j3-fortran.org
> http://mailman.j3-fortran.org/mailman/listinfo/j3
> 
> ________________________________________________________________________
> This e-mail has been scanned for all viruses by Star.
> ________________________________________________________________________
> 





More information about the J3 mailing list