MathGroup Archive 2014

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

Search the Archive

Re: packages...

  • To: mathgroup at
  • Subject: [mg132749] Re: packages...
  • From: "djmpark" <djmpark at>
  • Date: Thu, 22 May 2014 02:31:27 -0400 (EDT)
  • Delivered-to:
  • Delivered-to:
  • Delivered-to:
  • Delivered-to:
  • References: <> <28031635.197343.1400660649379.JavaMail.root@m03>

I missed this initial posting but I would like to point out a weakness, a
flaw I think, in the WRI package design.

If you have many packages, then you must make certain that the exported
symbols have a tree-like dependency.  When one uses BeginPackage statements
such as:

BeginPackage[packageA, {needed packages}] 

the code in the needed packages is also read in and if they involve exported
symbols from packages not yet read in (like packageA) then the symbols are
put into a `Private` context. So in the entire Application these symbols
will exist in both a Public and Private context, which doesn't work.

I would think that this problem would be solved if the needed packages part
of the BeginPackage statement only read the Public sections and did not read
the Private sections, if this could be arranged.

With perfect foresight one might write a strictly tree-like structure, but
if an Application is developed over time it might turn out that it becomes
difficult to maintain that structure. Other groupings of routines might seem
more natural.

So, at least for the present, don't go for too many packages in a single

David Park
djmpark at 

From: David William Annetts [mailto:david.annetts at] 


I suggest looking at the stock packages for how to do this. Graphics &
Statistics are good places to start.

On 20/05/14 08:16, Francisco Gutierrez wrote:
> Dear Friends:
> I want to create a relatively complex package, with the following
> `mypackage`Master, which can be invoked if one wants all the 
> utilities, and which calls all the subpackages (each one with several 
> functions)
> and
> `mypackage`Utilities1, ..., `myPackage`Utilitiesn,
> which ought to be available for being called independently if one only
needs a couple of specific functions.
> Furthermore, `myPackage`Master has common function that all the
subpackages need. What is the best way to proceed? Is it possible to put the
common functions in the Master package, and that each subpackage calls them
when needed?
> Thanks for your help
> Francisco

  • References:
    • packages...
      • From: Francisco Gutierrez <>
  • Prev by Date: Re: Help
  • Next by Date: Re: packages...
  • Previous by thread: Re: packages...
  • Next by thread: ListPointPlot3D[Tooltip[]] Help