Re: Default Symbol Names in Package Functions
- To: mathgroup at smc.vnet.net
- Subject: [mg96156] Re: Default Symbol Names in Package Functions
- From: magma <maderri2 at gmail.com>
- Date: Sat, 7 Feb 2009 03:37:38 -0500 (EST)
- References: <gmec67$a8j$1@smc.vnet.net>
In a way , I think Mathematica obliges the developer to use more foolproof programming. This is what I mean: Your symbol x is a special (default) value for a function (foo) that only makes sense if you load testpackage. So very likely also x makes sense only if you load testpackage (and perhaps some other accessory package). So x shouldn't be a Global symbol anyway (in most likely situations). In other words: x , like foo, should be defined in testpackage. So add x::usage=..... But if x is defined in some other AuxPackage or is really something very general whch is defined in the Global context, then include this other package or the Global context in the context path, using the approrpiate BeginPackage[.....] declaration. Something like: BeginPackage["context`",{"Global`","AuxPackage`",...}] hth