(j3.2006) C713 question

Van Snyder Van.Snyder
Wed Apr 1 14:34:58 EDT 2009


I guess I need to explain what I thought was obvious.

Consider the following.

module M
  type T
  type U
  ...
contains
  subroutine S1 ( A, B )
    type(t), intent(inout) :: A(*)
    type(u), intent(in) :: B
    ...
  end subroutine S1
  subroutine S2 ( A, B )
    type(t), intent(inout) :: A(*)
    type(u), intent(in) :: B
    interface assignment(=)
      module procedure S1
    end interface
1   call s1 ( a, ( b ) )
2   a = b
  end subroutine S1
module M

Statement 1 is permitted.
Statement 2 is prohibited.

I don't know how any particular compiler works, but one reasonable
method to implement defined assignment is a tree transformation that
converts statement 2 into statement 1 (see 09-007r1:12.4.3.4.3p2
287:1-3).

There is no technical problem.

What excuse do we have for enshrining, in a constraint, something that
ought to be in a corporate style guide, or maybe a textbook?





More information about the J3 mailing list