Carl Witty wrote: >> Anyway, as several have commented, this discussion has taken place >> many times before, but having to use >> sage: f(x)=x^2 >> instead of >> sage: f=x^2 >> many times for single-variable symbolic expressions could be very >> annoying in the long run, IMHO. Let's not be stultified by trying to >> solve computer problems when this is mathematical software; the >> distinction between symbolic and callable-symbolic seems different to >> me than e.g. formal power series versus actually convergent ones. >> FWIW. > > I don't understand this paragraph at all. What problem are you > talking about? The problem I see is that people are confused when > x(x+1) gives them (x+1); I wouldn't call that a computer problem > exactly.
I agree with Carl. I can't count how many times I've thought I would be annoyed by being more explicit (i.e., saying f(x)=x^2 instead of f=x^2), but it turned out to be not that bad. I also can't count the number of times that I've been glad and relieved that I was explicit when I came back and read or modified my code (i.e., suppose I want to change f=x^2+1 to f=x^2+c to analyze what happens when c changes? Now I have to go back through and change all of my code from f(1) to f(x=1)!). I very much support what pynac is doing, which to my understanding, is this: f(x,y) = x^2+y # explicitly ordered parameters f(-1,2) then gives 3 f=x^2+y # no explicit parameters for f, so they must be specified f(x=-1,y=2) then gives 3 f(-1,2) gives an error f.subs(x=-1,y=2) then gives 3 I think having x(x+1) return x+1 is a far greater annoyance than having to explicitly write f(x)=x;f(x+1) or x.subs(x=x+1) or even x(x=x+1), all of which would hardly be written as an innocent-looking mistake. I'm always telling my students to not leave off the "dx" in an integral, even though there is only one variable, since it is so very important when we introduce other parameters or move to multivariable calculus. I try to use d/dt notation for derivatives because it is more explicit about what variable I'm dealing with, even if initially we only see one variable. I think there are great benefits for three more keystrokes (i.e., "(x)") in the definition of a function if it makes things much more explicit and easy for anyone to understand and takes away innocent-looking errors that almost surely will trip new users up. Gee, the last few paragraphs sound a lot more rant-like than I intended. I wasn't trying to pick on anyone. I guess I was just realizing how strongly I support what I think are the conventions introduced by pynac. Thanks, Jason --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to sage-devel-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---