(j3.2006) Comment concerning TEAM_TYPE
Tue Oct 8 20:15:34 EDT 2013
> If everything in TEAM_TYPE is default-initialised, one does not need
> the constructor at all.
>Suppose one has a type
> type :: T
> type(team_type) :: MyTeam
> type(my_type) :: MyStuff
> end type T
>and one wants to create an initialized variable
> type(t) :: T_var = t(team_type(),my_type(42))
>That cannot be done without access to the team_type() constructor.
Yes it can.
type,extends(team_type) :: team_kludge
type(team_kludge),parameter :: kludge = team_kludge()
type(team_type),parameter :: null_team = kludge%team_type
type(t) :: t_var = t(null_team,my_type(42))
(rest of discussion snipped as being moot given the counterexample).
One might reasonably say that the kludge above is ugly, but I never claimed it
would be elegant! It seems to conform to the rules proposed in N1983 though.
Whether we intended to allow named constants of type TEAM_TYPE I cannot say...
................................Malcolm Cohen, Nihon NAG, Tokyo.
More information about the J3