home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / sci / math / symbolic / 3011 < prev    next >
Encoding:
Text File  |  1992-11-17  |  3.1 KB  |  92 lines

  1. Newsgroups: sci.math.symbolic
  2. Path: sparky!uunet!snorkelwacker.mit.edu!ira.uka.de!chx400!bernina!neptune!santas
  3. From: santas@inf.ethz.ch (Philip Santas)
  4. Subject: Re: MAPLE resources reccomendation
  5. Message-ID: <1992Nov17.210733.22082@neptune.inf.ethz.ch>
  6. Sender: news@neptune.inf.ethz.ch (Mr News)
  7. Nntp-Posting-Host: spica.inf.ethz.ch
  8. Organization: Dept. Informatik, Swiss Federal Institute of Technology (ETH), Zurich, CH
  9. References: <Bxtxzy.CJD@news.cso.uiuc.edu> <BxuxC6.Dxz@news.cso.uiuc.edu>
  10. Date: Tue, 17 Nov 1992 21:07:33 GMT
  11. Lines: 79
  12.  
  13.  
  14. In article <BxuxC6.Dxz@news.cso.uiuc.edu> Richard J. Gaylord <gaylord@ux1.cso.uiuc.edu> writes:
  15. >
  16. >this comment indicates a basic lack of understanding of the mathematica
  17. >programming  language.  there are MAJOR differences in the languages of
  18. >mathematica and maple (and macsyma). mathematica not only has  pattern
  19. >matching (which can be very important) but it has many more built-in
  20. >functions for functional style programming.
  21.  
  22. I do not quite understand what does the _number_ of _built-in_ functions
  23. has to do with Functional Programming. FP is based on simple concepts, and 
  24. basically on \lambda abstractions (functions and variables); for their
  25. implementation only _trivial_ built-in structures are needed.
  26.  
  27. Since you relate Patterns and FP, well, Mathematica Patterns _contradict_
  28. Basic Concepts from \lambda Calculus, like a-Conversion:
  29.  
  30. In[1]:= f[x_]:=Function[x,x]
  31.  
  32. In[2]:= f[1][2]
  33. Function::flpar: 
  34.    Parameter specification 1 in Function[1, 1]
  35.      should be a symbol or a list of symbols.
  36. Function::flpar: 
  37.    Parameter specification 1 in Function[1, 1]
  38.  
  39. Out[2]= Function[2, 2][3]
  40.  
  41. On the other hand in Scheme which is a functional language we get
  42. the _correct_ result:
  43.  
  44. 1 ]=> (define (f x) (lambda (x) x))
  45. ;Value: f
  46.  
  47. 1 ]=> ((f 1) 2)
  48. ;Value: 2
  49.  
  50. The same happens in SML (another functional language)
  51.  
  52. - fun f x = (fn (x) => x);
  53. val f = fn : 'a -> 'b -> 'b
  54.  
  55. - f 1 2;
  56. val it = 2 : int
  57.  
  58. Given the above, one observes that Maple behaves _correctly_ in this trivial 
  59. FP case:
  60.  
  61. f:=proc(x) (x->x) end:
  62.  
  63. f(1)(2);
  64.                            2
  65.  
  66. CAS systems have been mainly built for solving algebra problems and not for doing
  67. acrobatisms with various programming styles. If you want to program in an
  68. FP fashion, then there are many _excellent_ and widely used languages out there, 
  69. like Lisp, Scheme, and ML (which includes strong typing and automatic type 
  70. inferencing, among others). Of course, introducing FP concepts in a CAS environment
  71. is something positive, but one has to design it properly and has to think about
  72. the _orthogonality_ of the concepts.
  73.  
  74. Now, if you compare Mathematica, Maple and whatever, in terms of FP,
  75. then it is quite obvious which provides what.
  76.  
  77. Philip Santas
  78.  
  79.   "In an evolving universe those who stand still are really moving backwards"
  80. --------------------------------------------------------------------------------
  81. email: santas@inf.ethz.ch                 Philip Santas
  82. Mail: Dept. Informatik                Department of Computer Science
  83.       ETH-Zentrum              Swiss Federal Institute of Technology
  84.       CH-8092 Zurich                       Zurich, Switzerland
  85.       Switzerland
  86. Phone: +41-1-2547391
  87.       
  88.  
  89.  
  90.  
  91.  
  92.