Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.



Problem overloading a System function
Posted:
Jan 8, 2013 11:39 PM


Background to my question: Al Hibbard and I have developed the AbstractAlgebra package (https://sites.google.com/site/eaamhl/home ) and over the years, some of our names have been usurped by Wolfram for System functions. In V9, there is a new function called Symmetric which conflicts with our function for the symmetric group. Starting in V8, Wolfram used SymmetricGroup for the group, which was one of our alternate names for the Symmetric. In that case we changed our alternate name to SymmetricGroupAA.
Our solution this time has been to overload Symmetric since the System function acts on lists and ours has an integer argument. Overloading works fine except for one minor detail. Wolfram's Symmetric has no options, but ours does have a few. So when you type a valid expression like this
Symmetric[4,Mode>Textual]
The second argument appears in red because Mathematica knows that it doesn't fit the pattern of arguments for Wolfram's definition of Symmetric. It evaluates perfectly well, but it's annoying to see it in red. I had expected that since one of our definitions looked like this:
Symmetric[n_Integer?Positive,opts___?OptionQ] := Module[{mymode, G, po,sc,il}, etc. ]
the two argument pattern would not be flagged in red... but it is. Anyone know how to fix this?
Ken Levasseur UMass Lowell



