MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Mathematica daily WTF

  • To: mathgroup at smc.vnet.net
  • Subject: [mg115010] Re: Mathematica daily WTF
  • From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
  • Date: Tue, 28 Dec 2010 06:50:22 -0500 (EST)

On 26 Dec 2010, at 10:02, kj wrote:

> Mine has been deformed by programming languages other than Mathematica,
> in which assignment does transfer everything

The "fundamental principle" of Mathematica is that a "rewrite rule" based system and many similarities to other programming languages (in particular Lisp and other functional languages) are mostly matters of convenient syntax rather than anything deeper. In particular, Mathematica does not have "real" assignments, thus the "assignment" x==a;
simply creates an OwnValue for x (in other words, a global rewrite rule) and that's all:

 x == a;

OwnValues[x]

{HoldPattern[x]:>a}

The same applies to "functions" defined using set etc; they all simply create global rewrite rules. The only exception that comes to my mind is direct application of anonymous functions such as:

#^3 &@2

8

which seems to me the only genuine "functional" aspect of Mathematica (I would also argue that all claims of similarity between Mathematica and Lisp, not to mention the supposed "borrowing" are based on a very superficial understanding of Mathematica). As far as I know in its basic structure it is unlike any other programming language so it should not be surprising that

> the meanings that Mathematica puts on of bread-and-butter
> programming terms like "=="/"assignment", "value", and "dynamic
> scope" are entirely sui-generis

Andrzej Kozlowski


  • Prev by Date: Re; newbie list question
  • Next by Date: Circular neighborhood for ImageApply
  • Previous by thread: Re: Mathematica daily WTF
  • Next by thread: Re: Mathematica daily WTF