MathGroup Archive 2013

[Date Index] [Thread Index] [Author Index]

Search the Archive

Problem overloading a System function

  • To: mathgroup at smc.vnet.net
  • Subject: [mg129376] Problem overloading a System function
  • From: klevasseur at mac.com
  • Date: Tue, 8 Jan 2013 23:40:05 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-newout@smc.vnet.net
  • Delivered-to: mathgroup-newsend@smc.vnet.net

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




  • Prev by Date: Re: system of differential equations mathematica help
  • Next by Date: ListLinePlot: Transform labels from numeric to text
  • Previous by thread: Typesetting Tensor Indices
  • Next by thread: Re: Problem overloading a System function