Re: mathematica's syntax is very like lisp language
- To: mathgroup at smc.vnet.net
- Subject: [mg95944] Re: mathematica's syntax is very like lisp language
- From: John Doty <jpd at whispertel.LoseTheH.net>
- Date: Fri, 30 Jan 2009 05:45:39 -0500 (EST)
- References: <glj85j$dds$1@smc.vnet.net>
water wrote: > mathematica's syntax is very like lisp language. > > is there any relation between mathematica and lisp ? Wolfram was surely aware of Lisp and its application to computer algebra when he invented Mathematica. In terms of expression structure, they are very similar. One can certainly identify the "head" of a Mathematica expression with the "car" of a Lisp expression. The big difference is in evaluation. The Mathematica evaluator is driven by patterns in the expression, while the Lisp evaluator is driven by the car of the expression. Of course, in Mathematica it is common to make definitions that drive the evaluator to mimic the behavior of the Lisp evaluator. On the other hand, you can do other things, and "upvalues" are there to facilitate them, e.g.: f_[loki]^="Haha" for a silly example (try Sin[loki] after making this definition if you don't understand it). The Lisp evaluator does a single evaluation. The Mathematica evaluator continues to evaluate the results until the expression stops changing. And, related to this, the Mathematica evaluator simply leaves alone an expression that fails to match any definition, while an undefined function is an error in Lisp. -- John Doty, Noqsi Aerospace, Ltd. http://www.noqsi.com/ -- The axiomatic method of mathematics is one of the great achievements of our culture. However, it is only a method. Whereas the facts of mathematics once discovered will never change, the method by which these facts are verified has changed many times in the past, and it would be foolhardy to expect that changes will not occur again at some future date. - Gian-Carlo Rota