MathGroup Archive 2004

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

Search the Archive

Re: Mean

  • To: mathgroup at
  • Subject: [mg48190] Re: Mean
  • From: Bill Rowe <readnewsciv at>
  • Date: Mon, 17 May 2004 03:22:00 -0400 (EDT)
  • Sender: owner-wri-mathgroup at

On 5/15/04 at 3:56 AM, spam at husumtoften.invalid (Per R¯nne) wrote:

>BTW, is there a way to automatically load packages? The method
>mentioned in The Mathematica Book 5th Edition [page 401, 2.7.11,
>DeclarePackage] seem to demand a file with declarations that are
>explicitly called.

There are several ways to automatically load packages. The basic technique is to insert the necessary commands into the init.m file that is read when any new session is started.

I am aware of three commands asscociated with loading packages DeclarePackage, Needs and Get.

DeclarePackage doesn't of itself actually load the package, Instead it creates stubs for the functions that cause the package to be loaded when the functions are used. The advantage of this approach memory needed for the fucntions isn't used until the functions are used. That is less memory will be used by your notebook if you don't actually use the functions in the package.

Needs first checks to see if the package is loaded and then loads the package only if it has not already been loaded.

Get loads the package regardless of whether it has been loaded or not.

When a new session is started the behaviour of Needs and Get in init.m is the same.

So, for my self I use a combination of Get and DeclarePackage in my init.m. I use Get for those packages I find myself using in nearly all of my Mathematica sessions and DeclarePackage for those functions I use often but less frequently.

Also, most of the directories in the standard additions include a package such as Statistics`Master`. This package contains DeclarePackage statements for functions in the other Statistics package. So, inserting <<Statistics`Master` into your init.m file will allow you to use any of the statistics functions without explicitly loading any specific package.
To reply via email subtract one hundred and four

  • Prev by Date: Delay DE's
  • Next by Date: Re: A special kind of partitions of an integer
  • Previous by thread: Re: Mean
  • Next by thread: Re: Mean