Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!gatech!psuvax1!psuvm.bitnet!psuvmxa!cunyvm!byuvax!hallidayd From: hallidayd@yvax.byu.edu Newsgroups: comp.lang.fortran Subject: Re: Pointer examples and 8x Message-ID: <665hallidayd@yvax.byu.edu> Date: 28 Jun 89 22:21:53 GMT Lines: 41 Bob Allison (bobal@microsoft.UUCP), here are some responses to your articles concerning POINTERs (and how you feel the proposed Fortran use of such is not sufficiently functional): First, if what you object to is the different definition of ``pointer'' used in the standard---compared to the working definition you have come to from other languages---then lets simply change the name used in the proposed Fortran standard (see my posting suggesting we replace POINTER with ALLOCATABLE, message <662hallidayd@yvax.byu.edu>). (By the way, if Bob Corbett (corbett@beatnix.UUCP), or others, can provide the syntactical and semantic definitions for the fully general recursive data structures with implicit pointers expressed in message <2775@elxsi.UUCP>, I would greatly appreciate it. I don't have any love for ``pointers'', but I do need recursive data structures.) Secondly, in response to Walt's desire for an example of ``walking'' through trees, simply look in _Art of Computer Programming_ by Donald E. Knuth (walking through using auxiliary stack, pp. 317--318 (of course recursive calls do this implicitly), or traversal of threaded trees p. 320 ff.), but I warn you, all the ways expressed in Knuth for traversing trees and other recursive data structures can be accomplished using Fortran 8x POINTERs. Thirdly, the only real world application I have seen which requires POINTERs pointing to POINTERs is the Apple Macintosh's handling of its heap (to allow the operating system to reconfigure the heap at any time). However, this use of POINTERs pointing to POINTERs can be handled quite well, with perhaps even greater clarity than straight forward "pointers pointing to pointers", using data structures that have only a single field, with that field being a POINTER (as would be needed using the present Fortran proposal). (After all, since the syntax already, automatically, dereferences the first ``POINTER'' the syntax will look just as if a single POINTER was being used, with the name of the ``dereferencing'' descripter (field, operator, whatever) being whatever name seems appropriate to the programmer.) _____________________________________ / David Halliday \ | | | Internet: hallidayd@yvax.byu.edu | | BITNET: hallidayd@byuvax | | Us Mail: BYU Physics Department | | 296 ESC | | Provo, UT 84602 | \_____________________________________/