Re: Context Names Question
- To: mathgroup at smc.vnet.net
- Subject: [mg3963] Re: Context Names Question
- From: wagner at motel6.cs.colorado.edu (Dave Wagner)
- Date: Mon, 13 May 1996 01:46:23 -0400
- Organization: University of Colorado, Boulder
- Sender: owner-wri-mathgroup at wolfram.com
In article <4menil$jva at dragonfly.wolfram.com>, Xah Lee <xah at best.com> wrote: >A context name related problem. > >Suppose I have two packages, TrochoidPlot and TrochoidShow for example. >Both packages use the option name RotationRange for several of their >functions. > >Shadowing of RotationRange will occure after loading the second package. >Is there some code one can execute before or after loading so the option >RotationRange can be recognized in functions from either package? You can declare a subsidiary package, say, TrochoidCommon, that defines RotationRange. Then change the BeginPackage statement in TrochoidPlot to this: BeginPackage[TrochoidPlot`, TrochoidCommon`]; The second argument to BeginPackage causes TrochoidCommon to load whenever TrochoidPlot is loaded. Similarly for TrochoidShow. Since these packages are obviously tightly integrated, I suggest that you change your naming scheme to: Trochoid`Plot`, Trochoid`Show`, and Trochoid`Common`. That way, everything lives in one directory. The standard Statistics packages are structured in this way. Check them out for examples. Dave Wagner Principia Consulting (303) 786-8371 dbwagner at princon.com http://www.princon.com/princon ==== [MESSAGE SEPARATOR] ====