[RFC] Implementing ASSOCIATE

Daniel Kraft d@domob.eu
Sat May 8 16:48:00 GMT 2010


>> I don't see how this is accomplied with what you suggest.  Except of
>> course, if the hidden variable is always a pointer or you add a copy-back
>> right at the end of the associate block.  Pointer is probably not possible
>> here because then x would also need to be TARGET which it is not (and need
>> not be, AFAIK);
> 
> Well, the SELECT TYPE implementation works with pointers, IIRC. In the
> sense that the internal local variable acts as a pointer, without
> having all the formal properties of a Fortran pointer (only pointing
> to TARGETs etc).

Ok, I see.  And what's about something like:

ASSOCIATE (arr => my_array(1:100:3)%comp)

Is it also possible to craft such a local pointer to mimic that 
semantics for all cases the way you do it?

So do you think I can/should use the same strategy you did for all 
ASSOCIATE and it will work for all necessary cases?

My suggestion was to rather take the gfc_expr representing 
"my_array(1:100:3)%comp" and do some kind of "source code substitution" 
by replacing each occurence of the EXPR_VARIABLE arr inside the block by 
that expression.  What do you think about that?

(All that of course only for associating to variables, in the expression 
case I think the strategy is clear.)

Yours,
Daniel

-- 
Done:  Arc-Bar-Cav-Ran-Rog-Sam-Tou-Val-Wiz
To go: Hea-Kni-Mon-Pri



More information about the Fortran mailing list