home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!ogicse!uwm.edu!ux1.cso.uiuc.edu!news.cso.uiuc.edu!mm-mac25.mse.uiuc.edu!gaylord
- From: gaylord@ux1.cso.uiuc.edu (Richard J. Gaylord)
- Newsgroups: comp.lang.apl
- Subject: Re: What is an APL language?
- Message-ID: <Bxv6G3.K6@news.cso.uiuc.edu>
- Date: 17 Nov 92 14:19:13 GMT
- Article-I.D.: news.Bxv6G3.K6
- References: <BxsL3r.EG@watserv1.uwaterloo.ca>
- Sender: usenet@news.cso.uiuc.edu (Net Noise owner)
- Organization: University of Illinois
- Lines: 34
- X-Xxdate: Tue, 17 Nov 92 08:20:48 GMT
- X-Useragent: Nuntius v1.1.1d12
- X-Xxmessage-Id: <A72E5BE003019B19@mm-mac25.mse.uiuc.edu>
-
- Subject: What is an APL language?
- From: Paul Robinson, FZC@CU.NIH.GOV
- Date: Mon, 16 Nov 1992 04:40:52 GMT
- In article <BxsL3r.EG@watserv1.uwaterloo.ca> Paul Robinson,
- FZC@CU.NIH.GOV writes:
- >
- >One example of the power (or complexity) of the language is the means to
- >sum a list of numbers. For example, in any other language, if I wanted
- >the variable A to have the average of a list of 20 numbers, I'd have to
- >do a loop. Here's how it's done with APL:
- >
- > a <- +/ 10 34 14 12 22 66 99 44 11 21 94
- >
- >(and so on) This gives the "average" or "mean" of the numbers.
- >Try doing that with less than a loop and a set of data
- >statements or arrays, and so on. Also, the <- in APL is the
- >assignment symbol, a single character
- =========
-
- this was an unfortunate example to use.
-
- in mathematica
-
- a = Apply[Plus, {10, 34, 14, 12, 22, 66, 99, 44, 11, 21, 94}]
-
- (note: one can also use {10, 34, 14, 12, 22, 66, 99, 44, 11, 21,
- 94}/.List->Plus which using a rule-based programming aproach which
- requires more explanation than anyone here probably wants to hear).
-
- also, Maple offers the convert function to change a data structure list
- into an addition operation.
-
- in fact, i believe (but may be wrong) that almost all functional
- languages [which apl really isn't] will do this sort of thing .
-