On 10/17/07, Ted Kosan <[EMAIL PROTECTED]> wrote: > It also shows how I am wanting to use expand() with a SymbolicEquation > object. This approach seems to work fairly well except for the fact > that SymbolicEquation's _left and _right instance variables are > private. If these variables were public, this would provide the > functionality I need. What is the reason for them being marked > private?
There are methods left() and right() that give back the left and right hand sides: sage: a = 7*x - 8 == 2*x + 7 sage: a.left() 7*x - 8 sage: a.right() 2*x + 7 SymbolicEquations are immutable, i.e., if you want to do something to change an equation you should get back a new equation object. The _left and _right are "private"-ish, because you are *not* supposed to change them. For example, when you do: b._right = b._right.expand() in your notes, that makes me very unhappy, since you are changing something you shouldn't change. Better would be sage: b = (an equation) sage: b.expand_right() returns a new equation got from b by expanding the right hand side. Another maybe better possibility might be to have a very general method: sage: b = an equation sage: b.change_right( new right hand side) new equation which *returns* a new equation obtained from b by modifying the right hand side. This is kind of like change_ring and change_variable for polynomials over a fixed ring (not symbolic polynomials). -- 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://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/ -~----------~----~----~----~------~----~------~--~---