On Sun, Nov 2, 2008 at 9:53 AM, Robert Dodier <[EMAIL PROTECTED]> wrote: > > Justin C. Walker wrote: > >> On Nov 2, 2008, at 00:01 , [EMAIL PROTECTED] wrote: > >> > Is it possible to avoid need to declare variables with var commands? > > Sage has adopted Python's evaluation policy, in which it is an > error to evaluate an undefined variable. Mathematica adopted > Macsyma's policy, in which it is not an error; an unbound symbol > evaluates to itself. I don't know where Macsyma got that; > in Lisp, at present, it's an error to evaluate an unbound variable, > but maybe it was different in ancient times (1970's). > > Python is an interesting and useful language, but in some ways it > isn't well-suited to symbolic processing. Too bad about that.
I personally Python well suited to mathematical computation, and at least the approach in Python regarding undefined variables is consistent with every other general purpose programming language I've ever used. But it is definitely different than Mathematica. >> People coming from a Mathematica background should not assume that >> they know all there is to know about how to use a Computer Algebra >> System, and instead, read the documentation. > > This is so obnoxiously wrong, I just don't know where to start. What is wrong? That statement Justin made or that he made it at all? To say Justin's response as written above is wrong, is to say the following is true (I just negated what he wrote): "People coming from a Mathematica background should assume that they know all there is to know about how to use a Computer Algebra System, and should not read the documentation". The first line of section 2 of the tutorial (about calculus) is "The solve function solves equations. To use it, first specify some variables; ..." and gives an example of using var. I guess this suggests that one needs to use var. This would be a good place in the tutorial to insert a sentence that if you don't use var then you will get a NameError, and that this behavior is different than in Mathematica, and there is no mode to change this, since it's a basic feature of how the Python language works. William --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---