Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site hou3c.UUCP Path: utzoo!watmath!clyde!burl!hou3c!ka From: ka@hou3c.UUCP (Kenneth Almquist) Newsgroups: net.lang Subject: Re: APL myths Message-ID: <658@hou3c.UUCP> Date: Wed, 4-Jul-84 14:08:38 EDT Article-I.D.: hou3c.658 Posted: Wed Jul 4 14:08:38 1984 Date-Received: Thu, 5-Jul-84 00:28:44 EDT References: <1982@decwrl.UUCP> Organization: Bell Labs, Holmdel, NJ Lines: 47 > Another reason why I find APL more readable is its terseness. One short APL > expression (average) could be several lines (or pages) of FORGOL: > > DCL I integer; > dcl sum integer; > > sum = 0; > do i = 1 to length(vector) > sum = sum + vector(i); > end; > print sum/length(vector); > > as opposed to the APL definition (written here in ascii-ized form): > > (+/ VECTOR) % rho VECTOR In PL/1 (one of the languages covered under the term "FORGOL") the example becomes: sum(vector) / dim(vector) Hardly a big difference from the APL version. > I'm afraid that you've betrayed your lack of knowlege of APL by asking for > a way to write structured APL (saying that you've used it, is different > than saying that you understand it). One of the best elements of APL is > that it attempts to substitute powerful notation for procedural specification > (structured programming is a concept of procedural languages which APL tries > NOT to be). If APL tries not to be a procedural language, it certainly does not succeed. In ADA, I can write "array1 := array2" as a single assignment statement rather than setting up a loop. In PL/1 I can go farther, writing "array1 = array2 + array3". In FORTRAN, a matrix multiplication is typically a single subroutine call requiring the programmer to write no loops. > In other words, SP concepts aren't as necessary in APL because > the vast majority of loops and things, are eliminated because of APLs > powerful set of functions and operators. The vast majority of loops may be eliminated in APL, but what do you mean by saying that "things" are eliminated? I agree that APL frees the programmer from writing a lot of loops, but I don't see how it eliminates any other gotos. Since FORTRAN has a "do" loop, you can have loops in FORTRAN without using gotos. So why is there any less need for Rat-APL than for Ratfor? Kenneth Almquist