(j3.2006) are selectors allowed to be procedures ?

Bill Long longb
Fri Oct 23 10:19:27 EDT 2009



Jim Xia wrote:
> 
> j3-bounces at j3-fortran.org wrote on 10/22/2009 11:33:33 PM:
> 
>  > The question in this case is did we intend to limit X to being a data
>  > object [another case where we failed to limit 'pointer' to be a 'data
>  > pointer'], or did we intend to allow X to be associated with a
>  > procedure?  The later does seem to have useful functionality, and seems
>  > to be allowed by the current text.  I tried Jim's example with our
>  > compiler and it didn't complain.
>  >
> 
> 
> All the rules in the ASSOCIATE section are pointing to selectors being 
> data objects, nothing seems to imply the possibility they being 
> procedures.  If we were to allow procedures, then we need to include all 
> possibilities of a procedure as a selector.  That includes procedure 
> names, procedure pointer names, dummy procedures, procedure pointer 
> components, etc.  


I think it would be a good idea to explicitly allow this in the next 
round. You can make the same "simpler to read the code" argument for a 
procedure component as for a data component being aliased to a simple 
token by ASSOCIATE.


I don't think we're ready to do that yet.

All of this discussion is about a Fortran 2003 feature. This particular 
section does appear to be half-baked (allowing, at least literally, some 
forms of procedure and not others).  If you mean but 'not ready' that 
the door for features/edits in f2013 is not open, then I agree.  If you 
mean that there is a technical problem with implementing the current 
half-baked rule in a compiler, I don't see why that is the case. 
Effectively an associate construct is like an inlined call to an 
internal subroutine where the associate names are the dummy arguments 
and the selectors are the corresponding actual arguments. We allow 
procedure dummy arguments, so this is not a ground-breaking concept.




I'd be
> happy to limit the selectors to data objects for now, until we sort out 
> all the mess of the implications of having procedure selectors.
> 

I'd be less happy with this, but if anything it is an F03 interp issue. 
It might be possible to complete the baking as interp edits, rather than 
having to wait for a 2013 feature.

Cheers,
Bill



> Cheers,
> 
> 
> Jim Xia
> 
> XL Fortran Compiler Test
> IBM Toronto Lab at 8200 Warden Ave, Markham, On, L6G 1C7
> Phone (905) 413-3444  Tie-line 313-3444
> email: jimxia at ca.ibm.com
> D2/YF7/8200 /MKM
> 
> http://www.ibm.com/software/awdtools/fortran/xlfortran

-- 
Bill Long                                   longb at cray.com
Fortran Technical Support    &              voice: 651-605-9024
Bioinformatics Software Development         fax:   651-605-9142
Cray Inc., 1340 Mendota Heights Rd., Mendota Heights, MN, 55120





More information about the J3 mailing list