Path: utzoo!utgpu!attcan!uunet!seismo!sundc!pitstop!sun!chiba!khb From: khb%chiba@Sun.COM (Keith Bierman - Sun Tactical Engineering) Newsgroups: comp.lang.fortran Subject: Re: Why array notation Message-ID: <76259@sun.uucp> Date: 4 Nov 88 20:22:06 GMT References: <689@convex.UUCP> Sender: news@sun.uucp Reply-To: khb@sun.UUCP (Keith Bierman - Sun Tactical Engineering) Organization: Sun Microsystems, Mountain View Lines: 47 In article <689@convex.UUCP> mercer@mozart.UUCP (Randall Mercer) writes: >Does anyone know why FORTRAN-8x uses array notation rather than some >form of parallel do loop? What is the advantage of writing > > A(1:N)=B(2:N+1)+C(1:N) > >rather than something like: > > PDO 10 I=1,N ! PDO for "PARALLEL DO" >10 A(I)=B(I+1)+C(I) > >The latter requires minimal syntactic changes and, for long loops, is >more concise and readable. Is the problem with the details of defining >"PDO", or is it some more strategic reason? As I recall, there were several reasons: 1) Array notation was originally attractive to hardware types, and was intended to be relatively easy for existing and proposed array processors. 2) Arrays are a mathematical "first class object" and providing them in the language will help fill a semantic gap between what scientists write, and what computers want. 3) To a certain extent, it is adopting current practice, as extended fortrans (like the Q8 facility in CDC fortran) have similar notation. 4) related to 2: in the most common case, where we want to operate on the arrays in the "natural" fashion, it is simpler, viz A = B+C I think your case translates as A = B(2:N+1)+C Parallel structures were considered to be too researchy to be in f88, array operations were not (since they do exist in some fortrans, all APL's, and many other research languages). Members of the committee (rather than Observers like myself) may have more detailed recollections. Keith H. Bierman It's Not My Fault ---- I Voted for Bill & Opus