MathGroup Archive 2005

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

Search the Archive

Shadowing of symbols in a package

  • To: mathgroup at smc.vnet.net
  • Subject: [mg61233] Shadowing of symbols in a package
  • From: "Hannes" <HannesKessler at hushmail.com>
  • Date: Thu, 13 Oct 2005 01:39:40 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Dear Mathematica-experts,

here a brief example demonstrating my problem:

File UnitsPackage.nb

BeginPackage["PackageUnits`", {"Miscellaneous`Units`"}];
a = 2. Milli Meter;
EndPackage[];

--> By declaring the cell an initialization cell and saving the
notebook, Mathematica creates automatically PackageUnits.m

File CallPackageUnits.nb

SetDirectory[$HomeDirectory<>"\\Eigene Dateien\\Test\\Mathematica"];
Needs["PackageUnits`"];
b=a//SI

--> The following warning is generated by running the notebook:

Meter::shdw: Symbol Meter appears in multiple contexts {PackageUnits`,
Miscellaneous`SIUnits`}; definitions in context PackageUnits` may
shadow or be shadowed by other definitions.

and the expected result:

0.002 Meter

Should I ignore the warning, or does it indicate that something should
be done better?

Best regards,
Hannes Kessler


  • Prev by Date: Re: NET/Link return array from C++
  • Next by Date: Re: fourier transform
  • Previous by thread: Re: Re: big integer for Range
  • Next by thread: Re: Shadowing of symbols in a package