(j3.2006) C713 question
Bill Long
longb
Wed Apr 1 16:27:40 EDT 2009
Van Snyder wrote:
> 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
>
Could you fill in the ... below. I'm interested to see how you would
write this assignment routine.
> ...
> 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?
>
>
> _______________________________________________
> J3 mailing list
> J3 at j3-fortran.org
> http://j3-fortran.org/mailman/listinfo/j3
>
--
Bill Long longb at cray.com
Fortran Technical Support & voice: 651-605-9024
Bioinformatics Software Development fax: 651-605-9142
Cray Inc., 1340 Mendota Heights Rd., Mendota Heights, MN, 55120
More information about the J3
mailing list