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

Bill Long longb
Thu Oct 22 23:33:33 EDT 2009



Van Snyder wrote:
> On Thu, 2009-10-22 at 14:16 -0700, Jim Xia wrote:
>> "func(10)" is an expression, is it not?  Then what is X? 
> 
> X is the name of the value of "func(10)".
> 
> Because of [171:8-9 8.1.3.3p2], X cannot appear in a variable-definition
> context, unless func(10) returns a pointer result, because the target of
> a pointer -- if it has a target -- is always a variable.
> 


According to the interface, FUNC does return a pointer result.  It is a 
procedure pointer and the target is a subroutine. I didn't think 
subroutines were variables. Of course, X did not appear in a variable 
definition context in the example.

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.

Cheers,
Bill



-- 
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