Well, an example where repeated operations would make sense is the cross product. But I would recommend against making cross(a, b, c, ...). The reason is that the cross product is non-associative, so it's not clear if cross(a, b, c) means cross(cross(a, b), c) or cross(a, cross(b, c)).
I don't really know much about the outer product. Aaron Meurer On Mon, Aug 15, 2011 at 9:29 AM, Jim Jewett <[email protected]> wrote: > On Fri, Aug 12, 2011 at 3:05 PM, Vinzent Steinberg > <[email protected]> wrote: >> On 11 Aug., 21:31, Matthew Rocklin <[email protected]> wrote: >>> I personally like the functions, dot(a,b), etc... and would be sad to see >>> them left out. If you had to kick one I would get rid of the object oriented >>> syntax a.dot(b). This is just a personal preference though. >> >> I like about dot(a, b) that it is the general, clean syntax. a.dot(b) >> is nice for nested functions, so you can write a.dot(b).dot(c) instead >> of dot(dot(a, b), c). (In this case it does not apply for the dot >> product of course, but in general it might occur.) > > An alternative is to write things like that as a function to take an > arbitrary number of elements, so that you could write: > > intersection(a, b) > or > intersection(a,b,c,d,e) > > That way people don't have to mentally verify that there isn't a > sneaky place in the middle where another function sneaks in, or > parentheses suggest a different order. > > -jJ > > -- > You received this message because you are subscribed to the Google Groups > "sympy" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/sympy?hl=en. > > -- You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sympy?hl=en.
