Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!mailrus!ames!skipper!maine From: maine@altair.dfrf.nasa.gov (Richard Maine) Newsgroups: comp.lang.fortran Subject: Re: dpANS Fortran 8x Message-ID: Date: 18 Jun 89 02:28:38 GMT References: <150@unmvax.unm.edu> <13941@lanl.gov> Sender: news@skipper.dfrf.nasa.gov Distribution: usa Organization: NASA Dryden, Edwards, Cal. Lines: 59 In-reply-to: jlg@lanl.gov's message of 16 Jun 89 23:35:38 GMT jlg@lanl.gov writes: >From article <150@unmvax.unm.edu>, by brainerd@unmvax.unm.edu (Walt Brainerd): >> If you think of a pointer as just an ADDRESS >> then the proposed Fortran pointers do not fit with that model. >That is _exactly_ the model of pointers I have in mind (with the addition of >typed pointers so static type checking of the pointee is possible). >> If you think of a pointer as a POINTER (pointing to, referencing, or aliasing >> another object), then all uses of pointers in the proposed Fortran standard >> fit within this notion (including "tradidional" uses of pointers >> to implement linked lists and other data structures). >> ... >> In summary, the uses and description of pointers are consistent as proposed; >> it may not fit some notions of what people have thought of as pointers. >In summary, recursive data structures and array section aliasing are two >_separate_ and _distinct_ activities. In fact, it's hard to imagine using >the same pointer to do both of these in the same code! (And, if this does >happen, it's probably an unintended and hard to find error.) As a result, >they should have separate and distinct implementation in a programming >language - preferably _without_ using pointers for either feature. But array sections and related concepts are not just an isolated feature of 8x. They are so ingrained throughout the whole 8x standard that it is difficult to imagine a pointer implementation that did not take it into account. Virtually everything else does. For instance, how can I point to a vector formal argument with a pointer that is just an address? There is no guarantee that the elements of this vector are contiguous in memory. The 8x language in general is making a major move away from assuming things about memory layout. This tone permeates the entire standard (and is the source of plenty of complaints from those who like (need?) to diddle extensively with addressing at a low level). The idea of a pointer that is nothing but an address is antithical to this tone. As for examples of languages that incorporate such "strange" notions, how about ANSI Fortran 77? Pointers? In ANSI Fortran 77? Well, not exactly, but consider formal subroutine arguments. Although they don't go by quite the same name, they are closely related (note the simillarity of terminology in the formal words of the standard). The formal parameter does "point" to an actual parameter. Most Fortran 77 formal parameters do consist of just addresses. But not for character parameters. I would argue that character formal subroutine parameters in FORTRAN 77 constitute an admittedly limited but relevant example of this kind of construct. And, of course, if you let me cite 8x then many more cases of formal argument passing are like this. Richard Maine maine@elxsi.dfrf.nasa.gov (don't try to send to me @altair.dfrf.nasa.gov as it won't get through). -- Richard Maine maine@elxsi.dfrf.nasa.gov [130.134.1.1] (Outside mail won't get to altair.dfrf.nasa.gov, so don't bother trying).