MathGroup Archive 2009

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

Search the Archive

Share symbols among packages

  • To: mathgroup at smc.vnet.net
  • Subject: [mg97355] Share symbols among packages
  • From: Andrey <andrey.siver at gmail.com>
  • Date: Wed, 11 Mar 2009 05:08:28 -0500 (EST)

Hello group,

How to use Global symbols in several user packages?

That is, I have:

BeginPackage["MyPack1`"]

myVar::usage="My var";

myFun1::usage="My fun1";

Begin["`Private`"];
...
(* use myVar *)
...
End[]
EndPackage[]

BeginPackage["MyPack2`"]

myVar::usage="My var";

myFun2::usage="My fun2";

Begin["`Private`"];
...
(* use myVar *)
...
End[]
EndPackage[]

And then I would like to do like this:

myVar=data; myFun1[a,b,c]
myVar=data; myFun2[a,b,c]

The problem is:

myVar::shdw: "Symbol myVar appears in multiple contexts \!\({\"MyPack1`
\", \"MyPack2`\"}\); definitions in context \!\(\"MyPack2`\"\) may
shadow or be shadowed by other definitions."

Any ideas?


Regards,

-Andrey


  • Prev by Date: Re: Re: Bug in Pattern Matching with Condition?
  • Next by Date: Re: Re: Bug in Pattern Matching with Condition?
  • Previous by thread: Palettes Remembering Their Positions
  • Next by thread: Re: Share symbols among packages