Re: Implementing JAVA interfaces in FORTRAN 20xx
- From: e p chandler <epc8@xxxxxxxx>
- Date: Mon, 25 Aug 2008 16:01:36 -0700 (PDT)
On Aug 25, 10:31 am, fj <francois.j...@xxxxxxx> wrote:
On 25 août, 10:21, Reinhold Bader <Ba...@xxxxxx> wrote:
fj schrieb:
I don't want to use the inheritance here (because F2003 supports only
a single inheritance). For instance, I want to be able to declare
something like that :
type, extends(roottype), implements(ordered_type) :: mytype
Well, your initial example did not indicate this. In any case, this is a
form of limited multiple inheritance which indeed is not supported explicitly.
You can however have a type definition
type, extends(ordered_type) :: mytype
type(roottype) :: r
:
contains
: ! map needed TBPs of roottype, as well as deferred methods of ordered_type
end type
which will do the equivalent with only a little additional wrapper code..
If you need to override roottype methods anyway, the needed programming effort
is in fact the same.
[...]
Regards
But this is a pity because extending an abstract type associated with
predefined routine signatures is much easier than extending a actual
type.
And because this is much easier, it is possible in JAVA to extends
(more precisely to implement) as many abstract types (JAVA interfaces)
as necessary when it is possible to extend only a unique actual type
(single inheritance).
Please explain how this does any real good in Fortran at all. As I
understand it, you can not pass an array of integers to a routine
which expects an array of elements, each of which is of derived type,
each of which consists only of an integer.
- e
.
- Follow-Ups:
- Re: Implementing JAVA interfaces in FORTRAN 20xx
- From: fj
- Re: Implementing JAVA interfaces in FORTRAN 20xx
- From: glen herrmannsfeldt
- Re: Implementing JAVA interfaces in FORTRAN 20xx
- References:
- Prev by Date: Re: J3 Responses to Public Comments
- Next by Date: Re: J3 Responses to Public Comments
- Previous by thread: Re: Implementing JAVA interfaces in FORTRAN 20xx
- Next by thread: Re: Implementing JAVA interfaces in FORTRAN 20xx
- Index(es):
Relevant Pages
|