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


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

Load part of a package?

Started bynanobio9 <kuokan.liang@gmail.com>
First post2012-05-15 08:53 +0000
Last post2012-05-15 08:53 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

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

#10080 — Load part of a package?

Fromnanobio9 <kuokan.liang@gmail.com>
Date2012-05-15 08:53 +0000
SubjectLoad part of a package?
Message-ID<jot5il$amf$1@smc.vnet.net>
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!

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web