Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #15422

Re: basic namespace question, and access to BinarySearch

From Szabolcs Horvát <szhorvat@gmail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: basic namespace question, and access to BinarySearch
Date 2013-09-12 06:21 +0000
Message-ID <l0rmgg$59n$1@smc.vnet.net> (permalink)
References <l0mhe8$ld8$1@smc.vnet.net> <l0p70p$s2d$1@smc.vnet.net>
Organization Time-Warner Telecom

Show all headers | View raw


On 2013-09-11 07:44:25 +0000, Itai Seggev said:

> On Tue, Sep 10, 2013 at 03:33:47AM -0400, Alan wrote:
>> What is the proper way to get access to a package without adding that
>> package to $ContextPath?  If I use Needs, the package name is added to
>> $ContextPath.  (Of course I can remove items from $ContextPath.)
> 
> The short answer is there really isn't.
> 
> In[26]:= BeginPackage["foo`"]
> 
> In[29]:= EndPackage[]
> 
> In[30]:= $ContextPath
> 
> Out[30]= {"foo`", "DocuTools`", "InflationAdjust`", "FormulaData`", \
> "QuantityUnits`", "WebServices`", "System`", "Global`"}
> 
> The moment the package loads it will be added to $ContextPath.

I wouldn't say that there isn't a way…

Here's a link to the same question on Mathematica.SE (and the answer I like):

http://mathematica.stackexchange.com/a/5574/12

Block[{$ContextPath},  Needs["Combinatorica`"]]

I always load Combinatorica like this in version 8 and later.

I should note here that if you use the ToCombinatoricaGraph function 
from the GraphUtilities package, it'll force-add Combinarotica` to the 
context path.  I did point out how this is rather inconvenient to 
support@wolfram.com, but it wasn't fixed.

Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Re: basic namespace question, and access to BinarySearch Itai Seggev <itais@wolfram.com> - 2013-09-11 07:44 +0000
  Re: basic namespace question, and access to BinarySearch Szabolcs Horvát <szhorvat@gmail.com> - 2013-09-12 06:21 +0000

csiph-web