Wolfram Library Archive

Courseware Demos MathSource Technical Notes
All Collections Articles Books Conference Proceedings

Power Programming: Contexts and Shadowing

David B. Wagner
Journal / Anthology

The Mathematica Journal
Year: 1996
Volume: 6
Issue: 2
Page range: 41-51

Contexts are a mechanism for ensuring that symbols created by a package are distinct from symbols created by the user or by other packages. The biggest problem with contexts is shadowing, a situation in which a symbol in one context prevents the user from referring to a symbol of the same name in a different context. In this article, we first describe how packages use contexts and then we survey tools and techniques that exist for dealing with the shadowing problem. Finally, we develop a new package, AntiShadow, that prevents the most common form of shadowing.

*Wolfram Technology > Programming > Packages and Contexts