Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!haven!adm!cmcl2!lanl!jlg From: jlg@lanl.gov (Jim Giles) Newsgroups: comp.lang.misc Subject: Re: Answers, Chapter 1: TeX Message-ID: <4675@lanl.gov> Date: 1 Nov 90 19:43:34 GMT References: <4181@goanna.cs.rmit.oz.au> Organization: Los Alamos Natl Lab, Los Alamos, N.M. Lines: 38 From article <4181@goanna.cs.rmit.oz.au>, by ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe): > In article <4569@lanl.gov>, jlg@lanl.gov (Jim Giles) writes: >> [...] An array is a mapping from one or more bounded index sets >> to values of an underlying type. Each array is assumed distinct from >> all others unless _explicitly_ declared otherwise. > > A consequence of this definition is that array cross-sections (as in > PL/I, Algol 68, and Fortran Extended) are *NOT* arrays. [...] Well, Fortran Extended array cross-sections certainly are not arrays. If they are passed to subroutines, they can become arrays there. The reason they aren't arrays has nothing to do with aliasing though - cross sections are not indexible (so they don't meet the frist part of my definition of being mappings from index sets to values). Fortran Extended pointers are aliased arrays (which can be aliased to anything in their scope that has the target attribute and is the same underlying type). But, this constitutes an explicit declaration (thought not explicit enough to my taste - I have opposed the new standard) so they still fit into my definition (if only barely). An array section passed to a subroutine must not be aliased to any other argument or global variable that that is visible in the scope of the subroutine (unless explicitly declared as usual). In this case, the section is considered an array again - it can be indexed, etc.. Once again, this fits my definition. Still, you make a good point. The operations allowed on array sections should be carefully considered. The purpose of making the definition of arrays as I did was to allow the compiler (with very little assist from the loader) to produce efficient code for array manipulation and be assured that the optimizations are safe from aliasing. If some operations on array sections are possible which preserve this property but are in contradiction to my definition of arrays, then I am willing to add array sections as a separate data construct to my list and define those new operations on them. J. Giles