MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Difference between Needs and using the second argument


Andrew Moylan wrote:

>Is there any difference between (i) using the second argument of
>BeginPackage or (ii) explicitly calling Needs on any required packages?
>  
>
The difference is whether the symbols in the required packages are on 
the context path after loading the package. For example, with:

BeginPackage["MyPackage`", {"OtherPackage`"}]

after loading

<<MyPackage`

the exported symbols in OtherPackage are also available to the user. 
While, with

BeginPackage["MyPackage`"]

Needs["OtherPackage`"]

after loading

<<MyPackage`

the exported symbols in "OtherPackage" are not available to the user.

Carl Woll
Wolfram Research


  • Prev by Date: Re: Axis missing from simple ListPlot
  • Next by Date: Re: Axis missing from simple ListPlot
  • Previous by thread: Difference between Needs and using the second argument of BeginPackage
  • Next by thread: RE: Difference between Needs and using the second argument of BeginPackage