Re: multiple contexts in package
- To: mathgroup at smc.vnet.net
- Subject: [mg117993] Re: multiple contexts in package
- From: David Bailey <dave at removedbailey.co.uk>
- Date: Thu, 7 Apr 2011 08:07:13 -0400 (EDT)
- References: <inhap5$283$1@smc.vnet.net>
On 06/04/2011 10:12, Sebastian Hofer wrote: > I'd like to create a context for semi-hidden symbols (i.e. only provided if explicitly loaded) in one of my packages. How can I achieve such a thing? > My best bet was the following (inspired by looking at the Parallel package): > > BeginPackage["Package`"] > (*visible symbols*) > > BeginPackage["Package`Hidden`"] > (*semi hidden symbols*) > EndPackage[] > > Begin["`Private`"] > (*hidden symbolds*) > End[] > EndPackage[] > > Trying to load Package`Hidden` does not load anything though. Where am I going wrong? > > Best regards, > Sebastian > Maybe this is obvious to you already, but you can always create symbols in contexts with arbitrary names, just by typing the full name: In[624]:= Foo`fred=0 Out[624]= 0 In[625]:= ?Foo`* Foo`fred Foo`fred=0 David Bailey http://www.dbaileyconsultancy.co.uk