Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2000

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

Search the Archive

Re: Package naming

  • To: mathgroup at
  • Subject: [mg24723] Re: Package naming
  • From: "Allan Hayes" <hay at>
  • Date: Wed, 9 Aug 2000 02:31:22 -0400 (EDT)
  • References: <8mdk7g$>
  • Sender: owner-wri-mathgroup at


If you use


and put the file into, with Windows
    C :


will load the package.

I classify my own packags inside ExtraPackages so that, for example it might
appear in


and I would have use


To load, I would need

<< haypacks`Calculus`PiecewiseContinuous`

If added to the search path (given by  $Path) by

"C:\\Program Files\\Wolfram

Then I would be able to load with

<< Calculus`PiecewiseContinuous`

but then there would be a problem if, say, the StandardPackages included , a
package named PiecewiseContinuous inside the folder named Calculus

This problem can go on and on of course

Allan Hayes
Mathematica Training and Consulting
Leicester UK
hay at
Voice: +44 (0)116 271 4198
Fax: +44 (0)870 164 0565

"Jack Goldberg" <jackgold at> wrote in message
news:8mdk7g$536 at
> Hi once again,
> I need some help.
> I have just completed designing a package that tries to incorporate
> piecewise continuous functions seamlessly into Mathematica.  Naturally, I
> entitle the package  PiecewiseContinuous.  So, I want the user
> to be able to call this package by
> Needs["PiecewiseContinuous`"]
> or
> <<PiecewiseContinuous`
> just the way I can call  <<Algebra`    or    Needs["Collatz`"]  to get
> these to Packages to load.  (I know the difference between <<  and Needs;
> I use them both here to illustrate my problem.)
> Now the problem ...
> What do I put as the argument of BeginPackage[?] and where should the
> package be stored so that the call to load it is not too different from
> <<PieceWiseContinuous` ? I have a feeling these are related questions and
> the answer hinges on ContextPaths.   I might
> add that none of the books I have consulted directly address this issue.
> (I have a rather large library of Mathematica books by the way.)  For
> Maeder gives a host of examples in his book Programming in Mathematica.
> Here is one
> BeginPackage["RandomWalk`"]
> ...
> EndPackage[]
> but does not hint at where and how to store this package so that it can
> be loaded with the call  <<RandomWalk` .
> My best quess is this:  If the user (say me) stores the package in a
> folder `mypackages,  then the correct call to load PiecewiseContinuous is
> Needs["mypackages`PiecewiseContinuous`"]  since this will tell Mathematica
> to look for this function.  Is this right?
> Thanks all.  Learning Mathematica on my own tends to leave me with large
gaps in
> my knowledge- or at least in my confidence.
> Jacl

  • Prev by Date: RE: Help Visualization Advice ?
  • Next by Date: Re: Mathematica won't solve simple diff. eqn. system
  • Previous by thread: Re: Package naming
  • Next by thread: RE: Package naming