Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #13074

Problem overloading a System function

From klevasseur@mac.com
Newsgroups comp.soft-sys.math.mathematica
Subject Problem overloading a System function
Date 2013-01-09 04:39 +0000
Message-ID <kcisat$41h$1@smc.vnet.net> (permalink)
Organization Time-Warner Telecom

Show all headers | View raw


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

Back to comp.soft-sys.math.mathematica | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Problem overloading a System function klevasseur@mac.com - 2013-01-09 04:39 +0000
  Re: Problem overloading a System function "Nasser M. Abbasi" <nma@12000.org> - 2013-01-10 07:19 +0000

csiph-web