Re: Implementing JAVA interfaces in FORTRAN 20xx



On 26 août, 18:42, nos...@xxxxxxxxxxxxx (Richard Maine) wrote:
fj <francois.j...@xxxxxxx> wrote:
You might try to solve the problem with an equivalence :

TYPE :: integer_type
SEQUENCE
INTEGER :: value
END TYPE

integer :: vector(10)
type(integer_type) :: other(10)
equivalence (vector,other)

!.. you fulfill vector

CALL wonder_routine(other)

I've not quite figured out what the purpose behind this all was supposed
to be anyway, but note that as soon as you make a derived type a
sequence type, it is not extensible. This might defat the whole point,
if I've correctly guessed the objective (which I might not have).

This is, of course, in addition to the mant, many other "issues" with
equivalence.

Even if the "integer_type" I propose only extends an abstract type
like "ordered_type" ?

This might be related to the implementation of derived types which
extends another type. But if this other type is abstract then there is
no data inheritance. Therefore I have a question for compiler
programmers :

Is there any additional information stored into my "integer_type" if I
declare it extending "ordered_type" ?

This is perhaps also related to the more general question :

Are the pointers to the procedures bound to a type stored into the
objects of that type or is the choice the right routine (when
resolving a calling sequence) just a compilation task ?


--
Richard Maine | Good judgement comes from experience;
email: last name at domain . net | experience comes from bad judgement.
domain: summertriangle | -- Mark Twain

.