Re: Fortran 2003: abstract interfaces



On Jan 31, 2:54 pm, Arjen Markus <arjen.mar...@xxxxxxxxxx> wrote:
abstract interface
subroutine dothis( ... )
end subroutine
end interface
This abstract interface is part of a typ definition.

How do I specify that a particular routine implements the interface
"dothis"?
Is that via the procedure statement:
procedure(dothis) :: do_it_this_way

This works.

Or via:
interface dothis
module procedure do_it_this_way
end interface
Or how?

This does not work since (a) do_it_this_way is not a module procedure
and "interface dothis" clashes with "subroutine dothis" in the
abstract interface.

By the way: NAG f95, gfortran and g95 correctly accept the first
version and reject the second version. Thus to find out whether (a) or
(b) is valid, one can simply try it out and see what a compiler
accepts or rejects. If several compilers behave identically (which
support a given feature), it is a good indication that their
diagnostic is right.

Tobias
.



Relevant Pages

  • Re: For the AdaOS folks
    ... >> implementation could be a module, no problem, but all system objects, ... >> carrier, yes, as an interface no. ... Develop a general API to leave flexibility in the hands of the designer ... abuses, and secondly, we could define somewhere an abstract interface to be ...
    (comp.lang.ada)
  • Re: For the AdaOS folks
    ... gone beyond the registry in proposed solutions yet. ... > abuses, and secondly, we could define somewhere an abstract interface to be ... Yes of course - ie. it must support the Ada RTL, ...
    (comp.lang.ada)
  • Re: Fortran 2003: abstract interfaces
    ... subroutine dothis(... ... This abstract interface is part of a typ definition. ...
    (comp.lang.fortran)
  • Re: Fortran 2003: abstract interfaces
    ... I'm suspicious that you are confusing an interface and an interface ... particular procedure has a particular abstract interface, ... An interface block can define one or more interfaces. ... interface body specifies what specifics are included in the generic. ...
    (comp.lang.fortran)
  • Fortran 2003: abstract interfaces
    ... abstract interface ... subroutine dothis(... ... This abstract interface is part of a typ definition. ... (I can not find my copy of Fortran 95/2003 explained at the moment, ...
    (comp.lang.fortran)