On Sep 12, 2007, at 5:19 PM, William Stein wrote: > On 9/12/07, Soroosh Yazdani <[EMAIL PROTECTED]> wrote: >> BTW, I don't think this is a good idea: >>>> sage: x, y=vars('x y') >>>> sage: y + sin >>>> y + sin(y) >>>> sage: x + sin >>>> x + sin(x) > > That's definitely not how SAGE works now, and now how > it should work. This is what currently happens: > > sage: x,y = var('x y') > sage: y + sin > sin + y > sage: x + sin > sin + x > sage: (x + sin)(5) # this is bad -- it's the trac ticket robert > opened > sin + 5 # should be sin(5) + 5.
Letting x + sin == x + sin(x) was my way of justifying (x + sin)(5) == 5 + sin(5). I was thinking "sin" was a function of exactly one variable, it just doesn't know/have a name for that variable yet. Perhaps this was a bad idea, but then it is unclear what (x+sin) is. For callable symbolic expressions I think it may be a bit clearer. sage: f(x) = x^2 sage: f + sin x^2 + sin(x) # because f.parent()(sin) = sin(x) ?? Also, what should (x+y+sin)(5) be? An error? 5+y+sin? What should sin.variables() return? I think it should be a tuple with one element, as it takes one argument... Or something special? - Robert --~--~---------~--~----~------------~-------~--~----~ 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://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/ -~----------~----~----~----~------~----~------~--~---