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

Bill Long longb
Thu Oct 22 16:56:01 EDT 2009



Jim Xia wrote:
> 
> I know the selectors in ASSOCIATE or SELECT TYPE are meant to be used as 
> data object.  But where in the standard it says it can not be a 
> procedure?  The example
> 
> 
>     interface
>         subroutine foo
>         end subroutine
>     end interface
> 
>     interface
>         function func (i)
>             import foo
>             procedure(foo), pointer :: func
>         end function
>     end interface
> 
>     associate (x => func(10))
>         call x

Interface says FUNC is a function, so

    call x

looks like a syntax error at best.

In general, a <selector> is either <expr> or <variable>.  A subroutine 
name does not qualify as either of these.

Cheers,
Bill




>     end associate
>     end
> 
> 
> Should we explicitly disallow this?
> 
> 
> 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