Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2000
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*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

Package naming

  • To: mathgroup at smc.vnet.net
  • Subject: [mg24673] Package naming
  • From: Jack Goldberg <jackgold at math.lsa.umich.edu>
  • Date: Fri, 4 Aug 2000 01:18:59 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

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 instance,
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 where
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: Mathematica won't solve simple diff. eqn. system
  • Next by Date: RE: Re: Manipulating Slot objects in Compile
  • Previous by thread: Re: Mathematica won't solve simple diff. eqn. system
  • Next by thread: Re: Package Naming