Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2009

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

Search the Archive

Re: Needs[], BeginPackage[], filename

  • To: mathgroup at smc.vnet.net
  • Subject: [mg101090] Re: Needs[], BeginPackage[], filename
  • From: Bill Rowe <readnews at sbcglobal.net>
  • Date: Wed, 24 Jun 2009 06:28:33 -0400 (EDT)

On 6/22/09 at 4:21 AM, smartin at seas.harvard.edu (Scot T. Martin)
wrote:

>Needs[] allows the context and filename to be specified.

>BeginPackage[] allows a context and not a file name.

>Then, my packages require two steps, as in the following example:

>** start **

>Needs["sizedistribution`", "size functions.m"]

>BeginPackage["tandemdma`", {"sizedistribution`"}]

>** stop **

>Are two steps really necessary or am I missing something very
>simple?

Have you looked at the online documentation for BeginPackage in
the Documentation Center? There is a comment immediately
following the second syntax example that states Needs will be
called for each of the items in the second argument. To do this
in one step, this should work

BeginPackage["tandemdma`", {"sizedistribution`","size functions`"}]

This assumes the files to be loaded are both in a directory
contained in the list returned by $Path.



  • Prev by Date: Possible bug in Mathematica 7 using ColorFunction
  • Next by Date: Re: For loops with mathematica....
  • Previous by thread: Re: Needs[], BeginPackage[], filename
  • Next by thread: Non-converging integral with linear transformation?!