On Sunday, November 10, 2013 11:31:38 PM UTC+1, Aaron Meurer wrote: > > > Mathematically, + has a thousand meanings, and we blur the > distinctions because they all act similarly. But at some point in a > CAS, you have to unblur any notational convenience that you would > otherwise make on paper. >
In Wolfram Mathematica, + is a Plus M-expression, always. They don't have any MatPlus, or whatever. The behavior upon it is determined by pattern matching. I don't know how it works, but I guess that Mathematica builds up some indices to speed up the pattern search. I don't think pattern matching is the only way. I would suggest to make Add, Mul and Power just containers for the corresponding operators (+, *, **), while creating parallel classes to represent the precise logical operation that those signs are meant to represent. Otherwise, things could be done the opposite way, create an Add-like object for every logical operation, which means making Add abstract, and along with already existing classes like MatAdd, add stuff like: AssocAdd, InfinitiesAdd, NCAdd, InfinitiesNonCommutativeAdd, NumericAdd, QuantumOpAdd and so on. I don't think this is a good idea, too many classes to define. -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sympy. For more options, visit https://groups.google.com/groups/opt_out.
