Well, I don't want to take the thread off topic, but in the standard (documented) way of creating new operators, it is done with an assignment to MakeExpression. This will work in a notebook, where boxes are transformed into expressions before execution, but it will not work in a .m file, because that isn't processed by MakeExpression.
On Sep 27, 6:57 am, Jason Grout <[EMAIL PROTECTED]> wrote: > Chris Chiasson wrote: > > It might be worth pointing out that adding "new" syntax in Mathematica > > is (usually) done by assignments to the function that transforms > > general two dimensional input into source code. That isn't really the > > same thing as adding a new operator to the language itself. > > Adding a new operator to the language itself means that you change the > parser to interpret the new operator. That's exactly what you're doing > in Mathematica by modifying the function that converts input to a nested > list of function calls (defined by the user or by the base system > library). So I guess I don't see a difference in your distinction > between these two cases. Of course, I could be missing something here. > > In the above discussion, though, I was mainly referring to the way that > Mathematica can take the same function and call it in prefix, infix, and > postfix syntax. So you can write one function, "disjoint_union", and > call it via: "disjoint_union[a,b]", "a `disjoint_union` b", or "[a,b] // > disjoint_union[#[[1]],#[[2]]]& > > Thanks, > > -Jason --~--~---------~--~----~------------~-------~--~----~ 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/ -~----------~----~----~----~------~----~------~--~---