(j3.2006) Is this prohibited? (with obvious blunder repaired)
Van Snyder
Van.Snyder
Tue Jun 18 21:08:35 EDT 2013
On Tue, 2013-06-18 at 18:04 -0700, Van Snyder wrote:
> It's not obvious that this is prohibited, but nobody seems to like it:
>
> module M
>
> contains
>
> function F ( A )
> integer, intent(in), optional :: A
> integer :: F(merge(2,3,present(a))) ! <--- This is where the objections occur
integer :: F(merge(3,2,present(a))) ! <--- Repair obvious blunder !!!
> if ( present(a)) then
> f = (/ 1, 2, a /)
> else
> f = (/ 1, 2 /)
> end if
> end function F
>
> end module M
>
> It seems that 7.1.11p2(9)(b) together with 7.1.11p4(1) allow it.
>
> If it's prohibited, is there a good reason to retain the prohibition?
>
>
> _______________________________________________
> J3 mailing list
> J3 at mailman.j3-fortran.org
> http://mailman.j3-fortran.org/mailman/listinfo/j3
More information about the J3
mailing list