home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / apl / 1182 < prev    next >
Encoding:
Internet Message Format  |  1992-11-17  |  1.8 KB

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