MathGroup Archive 2005

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

Search the Archive

Re: UpValues for expressions headed by a string

  • To: mathgroup at
  • Subject: [mg63086] Re: UpValues for expressions headed by a string
  • From: dh <dh at>
  • Date: Tue, 13 Dec 2005 03:41:46 -0500 (EST)
  • References: <dn8fra$bof$> <dn8r0m$hl5$>
  • Sender: owner-wri-mathgroup at

Hi Trevor,
according to our private conversation you have problems implementing a 
function that takes different types in different packages.

Well, a symbol can only live in one context. Therefore, if you define 
the behaviour of a symbol in more than one package, you must take care 
to give the right context:
- The first package will set the context. The usage message must go here.
- all further packeges must address the symbol with the right context. 
No usage statement here.

Here is an example:

fun::usage = "blabla";
fun[x_Integer] := Print[x];

aa`fun[x_String] := Print[x];

Note the aa` in the second package.


  • Prev by Date: Re: How to compute this sum?
  • Next by Date: Re: Re: How to hide a cell?
  • Previous by thread: Re: UpValues for expressions headed by a string
  • Next by thread: Re: Bug in Graphics output of Circle primitive?