(j3.2006) J3/13-278, interp F08/0095

Robert Corbett robert.corbett
Thu Jun 27 00:08:17 EDT 2013


On 06/26/13 03:33, Van Snyder wrote:
> On Tue, 2013-06-25 at 22:28 -0700, Robert Corbett wrote:
>> The inquiry function PRESENT appears not to violate the conditions required of a
>> specification expression.  However, the intrinsic inquiry ALLOCATED and the
>> single argument form of ASSOCIATED also appear not to violate those conditions.
>> The function PRESENT acts more like an assumed property than like a deferred
>> property in that it have the same result throughout the execution of the
>> subprogram.  The same is not true of ALLOCATED.  The same is also not true of
>> ASSOCIATED, except in the case where the argument to ASSOCIATED has INTENT(IN).
> I don't think there's a problem in the standard with
>
>    function F ( A )
>      integer, allocatable :: A(:)
>      real :: F(merge(3,2,allocated(a)))
>    end function F
>
> or
>
>    function G ( A )
>      integer, pointer :: A
>      real :: F(merge(3,2,associated(a)))
>    end function G
>
> I haven't asked any processors whether they accept this.

What prevents ALLOCATED and ASSOCIATED from appearing in constant expressions?  
Like PRESENT, the text of the standard makes them specification inquiries.  
Which condition does the subroutine

       SUBROUTINE SUBR(P)
         POINTER P
         LOGICAL :: L = ASSOCIATED(P)
       END

violate?

Bob Corbett



More information about the J3 mailing list