Print

Print


Neil Carlson writes:
 > Thanks, Richard; I expected you'd be likely to reply first!
 >
 > >  > INTENT(OUT) asserts that the pointer association
 > >  > will be set by the procedure,
 > >
 > > Not quite.  The procedure does not necessarily need to set it.
 > > It is undefined until the procedure does set it, but as long as
 > > it doesn't end up getting referenced, it may be fine for it
 > > to be undefined.
 >
 > Do you really mean "undefined" as in can't use ASSOCIATED on it?

Yes.  And "can't use" means that it is illegal to do so, not that
the compiler will necessarily catch the error - just that "bad things"
might happen.

 > If in the derived type definition the pointer component had been
 > initialized with "=> NULL()" would the dummy argument pointer
 > component start with the "dissassociated" status, or does the standard
 > leave these specifics up to the individual implementation?

In that case, the default initialization would apply, so you would
start with dissassociated status.  Or perhaps you start up undefined,
but then the initialization happens, which defines it.  I forget which
of those two ways it is described, but the end effect is the same.  I
was debating whether to bring default initialization up, but decided
not to.  Guess I decided incorrectly.

For that matter, in f2k if the type has a finalizer, something might
happen.  I'm afraid I can't keep the details of finalizers straight,
so you'll have to ask Kurt or someone else who understands them
about that.  It seems to me that they happened at times that seemed
non-intuitive to me...possibly including times that seemed more like
when you'd expect initialization.  Maybe the actual argument gets
finalized before the call...or something...don't quote me on it.

--
Richard Maine                |  Good judgment comes from experience;
[log in to unmask]   |  experience comes from bad judgment.
                             |        -- Mark Twain