(j3.2006) PRESENT in specification expressions

Van Snyder van.snyder
Wed Jun 26 06:33:14 EDT 2013


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.

> Robert Corbett
> _______________________________________________
> J3 mailing list
> J3 at mailman.j3-fortran.org
> http://mailman.j3-fortran.org/mailman/listinfo/j3





More information about the J3 mailing list