(j3.2006) scope of implicitly declared entities in BLOCK constructs

Van Snyder Van.Snyder
Fri Mar 6 17:53:29 EST 2009


On Fri, 2009-03-06 at 02:51 -0800, Robert Corbett wrote:
> As the draft Fortran 2008 standard is currently written,
> a data entity that is implicity declared in a BLOCK
> construct has the scope of the outermost scoping unit
  Actually innermost ------------^^^^^^^^^
  A block is not a scoping unit.
> that contains it.  Thus,
> 
>        PROGRAM MAIN
>          BLOCK
>            I = 10
>          END BLOCK
>          PRINT *, I
>        END
> 
> conforms to the draft standard, but
> 
>        PROGRAM MAIN
>          BLOCK
>            INTEGER I
>            I = 10
>          END BLOCK
>          PRINT *, I
>        END
> 
> does not.  Is that the intent of the committee?

This was precisely the intent.

This program also conforms:

  program main
    block
      i=10
    end block
    block
      print *, i
    end block
  end program

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




More information about the J3 mailing list