(j3.2006) Comment concerning TEAM_TYPE
Mon Oct 7 19:30:30 EDT 2013
On Mon, 2013-10-07 at 18:02 -0500, Bill Long wrote:
> On 10/7/13 5:36 PM, Van Snyder wrote:
> > For LOCK_TYPE and EVENT_TYPE, it is specified that all components have
> > default initialization. This means that one can use the type
> > constructor.
> For LOCK_TYPE and EVENT_TYPE it makes sense to have initialized
> components because you want to be able to do an EVENT WAIT on an event
> variable that is not otherwise defined yet, or have a lock variable
> properly initialized for correct detection of wrong usage. Those sorts
> of arguments do not seem to apply to a TEAM_TYPE object. What team would
> it be initialized to? A NULL team with no images? It seems unhelpful
> to introduce a concept just for the benefit of enabling initialization.
It might be useful to have a team variable initialized to a value that a
CHANGE TEAM statement would recognize as never having been given a value
by a FORM TEAM statement. It might be useful to have CHANGE TEAM return
a status value that indicates its team variable has not been given a
value by a FORM TEAM statement.
This is orthogonal to whether one can explicitly initialize a team
variable by using the type constructor.
> Given the restrictions on the usage of things declared TEAM_TYPE, of
> what use is a type constructor?
It is desirable to be able to use the constructor, presumably giving a
"never appeared in a FORM TEAM statement that was executed" value.
Otherwise, an object with a TEAM_TYPE component cannot be initialized.
If a TEAM_TYPE component has no default initialization and it is
private, the constructor for the type cannot be used outside the module
where the type is defined. If the TEAM_TYPE component is private and
the constructor cannot be used, an object of the type still cannot be
initialized, even in the module where the type is defined. If it isn't
private, and not initialized, the constructor still cannot be used
because without a constructor there's no way to give a value for a
> > This is not specified for TEAM_TYPE.
> > The TS ought to say explicitly that they all do have default
> > initialization, or that there is at least one that does not, so users
> > will know whether the type constructor can be used.
> I assume that the default is always that things are not default
> initialized, but that could be stated explicitly.
It should be stated.
> > _______________________________________________
> > J3 mailing list
> > J3 at mailman.j3-fortran.org
> > http://mailman.j3-fortran.org/mailman/listinfo/j3
More information about the J3