I think Schulz comes pretty close to the main reason "why the Powers
That Be created the Standard They Created", and Clive Page is correct in
stating that the decision may have been somewhat misguided.
I remember some of the discussions, and it seems to me that the
prevailing viewpoint was that association status needs to be initialized
the same as variable values; and the minority view expressed by Page
(that they are not at all analogous) was mentioned but was voted down.
As I recall, I was on the prevailing side, but later regretted my stand.
Meanwhile, we have at least been provided with smoother ways of
initializing association status.
Loren P. Meissner
[log in to unmask]
> -----Original Message-----
> From: [log in to unmask]
> [mailto:[log in to unmask]]On Behalf Of Peter
> Shenkin
> Sent: Wednesday, September 23, 1998 7:30 AM
> To: fortran90 mailing list
> Subject: Re: A rare behaivor of pointers
>
>
> On Sep 23, 10:09am, Dr W.W. Schulz wrote:
> > Subject: Re: A rare behaivor of pointers
> > On Tue, 22 Sep 1998, Michael Metcalf wrote:
> >
> > > Not necessarily. A pointer is created with the association
> > > status 'undefined' and cannot be tested by ASSOCIATED
> > > in that condition. All pointers should first be initialised to the
> > > 'disassociated' status with, for instance, the NULLIFY intrinsic.
> > > In Fortran 95, pointers can be specified to have an initial
> > > association status using the ' => NULL()' syntax in the type
> > > statement.
> >
> > What is the reason behind the Fortran rule that pointers are
> > initially undefined (unless initialized to something in F95)?
> > Why can't it be disassociated? etc. etc.
> >
> > I find this behaviour very unsatisfactory esp. since one cannot
> > test an undefined pointer for its status. It's a major pain in
> > the neck for writing solid code.
>
> Of course I can't comment authoritatively on why the Powers That Be
> created the Standard They Created, but the behavior, though a
> pain at times, is intuitive to me.
>
> Pointers are like other variables, in the sense that they have
> to be initialized before they are used. Asking why an uninitialized
> pointer isn't automatically nullified is like asking why an
> unitialized
> integer isn't automatically set to zero.
>
> Then, if you have a local pointer variable without the SAVE
> attribute, do you want it automatically nullified every time
> the routine is entered? Presumably you'd have to do this.
>
> -P.
>
> --
> *** "Freedom's just another word for nothing left to lose."
> (B. Yeltsin)***
> *Peter Shenkin; Chemistry, Columbia U.; [log in to unmask]
> (212)854-5143*
> *MacroModel WWW page:
http://www.columbia.edu/cu/chemistry/mmod/mmod.html *
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|