Fri Dec 3 16:49:11 EST 2010
On Fri, 2010-12-03 at 13:37 -0800, Bill Long wrote:
> On 12/3/10 1:20 AM, Robert Corbett wrote:
> > An engineer at Oracle recently asked me if the actual
> > argument passed to the argument MOLD of the intrinsic
> > function TRANSFER can be polymorphic. If so, he wanted
> > to know if the declared type should be used or the
> > dynamic type. I searched Clause 13 for the answer, but
> > I found nothing. I told him to assume that it is allowed,
> > and that the declared type should be used. Did I miss
> > something in the standard that answers his question?
> Generally, the convention is that "type" of an object, without either
> 'dynamic' or 'declared' modifier, means its dynamic type. In this
> particular case, that would seem to make the most sense anyway.
> Typically, you would write
> x =transfer(y, MOLD=x)
> and you want the bits of the actual object x to be the bits of y for the
> type of x at that particular point in the program's execution (which is
> the definition of dynamic type).
Or you could use a Select Type construct....
> > Bob Corbett
> > _______________________________________________
> > J3 mailing list
> > J3 at j3-fortran.org
> > http://j3-fortran.org/mailman/listinfo/j3
More information about the J3