Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!unmvax!brainerd From: brainerd@unmvax.unm.edu (Walt Brainerd) Newsgroups: comp.lang.fortran Subject: Re: dpANS Fortran 8x Summary: The semantics are described Message-ID: <147@unmvax.unm.edu> Date: 15 Jun 89 03:56:26 GMT References: <143@unmvax.unm.edu> <13938@lanl.gov> Distribution: usa Organization: University of New Mexico at Albuquerque Lines: 61 In article <13938@lanl.gov>, jlg@lanl.gov (Jim Giles) writes: > >> > REAL, DIMENSION (100, 100), TARGET :: A > >> > REAL, DIMENSION (100), POINTER :: P > >> > . . . > >> > P => A (50, :) ! P IS AN ALIAS FOR ROW 50 OF A > >> > >> In order to implement this, the pointer must actually be (what used to be > >> called) a 'dope vector'. > > > > Exactly right! And the standard requires that this be implemented! > > Since Walt is on the committee (or was - I don't know his present status), He is still on it. > I will assume he is right about the interpretation of the standard. I was Not necessarity a good assumption, in general! > only pointing out that the present proposal, as written, does _not_ give > any _semantic_ interpretation for the above example. At least to my mind, > a comment on a example statement does _not_ constitute an adequate definition > of the semantics of a programming language feature. If they intend for a > POINTER value to actually be an entire array descriptor or 'dope vector', > then they should say so explicitly and fully describe what that means. > Failure to do so indicates to me that the meaning of POINTER is not well > defined. My example doesn't provide the semantics, but the standard does. The syntax is pointer-name => target An instance of a target, if you follow thru the syntax, is an array section, as in the example above. The semantics are given by: "A pointer assignment statement associates a pointer with a target." The term "associated" is widely used in the standard; very roughly, it means they are aliased. In the example above, this means that I can PRINT *, A (50, 23) or PRINT *, P (23) with the same result. The standard cannot suggest an implementation, such as a dope vector; it can only describe what must happen. > > Of course, if POINTER is supposed to be defined as Walt claims, it isn't > really a pointer. So it's misleading to people who know pointers from > other languages. Furthermore, it needlessly complicates the semantics > of pointers when they are used in more conventional roles (recursive > data structures, for example). I don't follow this. It simply means it can point to more complex objects than in many languages. I also don't see how it complicates things when pointers are used to implement recursive data structures; if you have "nodes" in a linked list consisting of an integer (say) and a pointer to the next node, then, thinking truly of recursive data structures, the pointer is just an alias for the rest of the list. So a list of integers is either empty or a) an integer and b) a list of integers (i.e., the pointer component). Walt Brainerd, Unicomp, Inc. brainerd@unmvax.unm.edu