Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #10080

Load part of a package?

From nanobio9 <kuokan.liang@gmail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Load part of a package?
Date 2012-05-15 08:53 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <jot5il$amf$1@smc.vnet.net> (permalink)

Show all headers | View raw


Hi, all,

The question is: when one loads a package with quite a lot of
information, for example, PhysicalConstants, often one eventually
finds that only 2 or 3 of them are used, however, a lot of definitions
are loaded in global space. (In this specific example, moreover, Units
package is also loaded, I think.) Similar things happens to my home-
made packages. If I store a lot of pre-calculated results and
definitions and so on in one place (at times I cannot find a
reasonable way to divide them into separate files), I have to load
everything together.

One of the ways to reduce the system load is to write a routine to
load the package, return the item I want, and Clear all other things.
This, however, takes a lot of time of writing stupid programs. For
example, to load a constant value from the PhysicalConstants package,
I have to use a Module in which all of the constants in the package
are declared local explicitly so that they will be "destroyed" after
dismissing the module. Moreover, it will not save the time of loading
the package. I am not good enough to be able to figure out what I
should clean up with the Units package which is invoked by the
PhysicalConstants package. In short, it can be done, but in painful
ways.

So have any of you ever thought of how to handle such situation? More
specifically, is there a "program pattern" with which one only picks
up specific part of a package?

Thank you very much!

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Load part of a package? nanobio9 <kuokan.liang@gmail.com> - 2012-05-15 08:53 +0000

csiph-web