MathGroup Archive 2005

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

Search the Archive

Contexts and DumSave


I have a package mypack.m in which I compute a time-consuming expression:




expr = (complicated)



So I am considering to save the expression with a DumpSave["",expr]
inside the package. Thus the full name of the expression is mypack`expr

Then in a notebook I want to load the expression
 << "mypack`"

If the file does not exists, then mypack.m is called and the
expression is computed and exported. $ContextPath is updated with mypack`

However if does exist, then mypack.m is not called (OK), the
expression is loaded from the .mx file and I can quickly have it with
mypack`expr. But in this case $ContextPath is not changed, so the short
name expr is not recognized.

In other words, expr only exists within context mypack`, but the <<
instruction does not load the appropriate context when the .m file is not

Thus my question is: when the .mx file is created within a package, how can
I get the expressions inside without typing their full name ?

I could hack $ContextPath but I guess this is not the correct way to do.

I don't want to compute and DumpSave the expression within the global`
context, which is an obvious solution to my problem.

Many thanks.


  • Prev by Date: Re: Re: Bug in Import?
  • Next by Date: Re: Re: Bug in Import?
  • Previous by thread: Re: FindRoot/NDSolve problem in VS5
  • Next by thread: Rearranging a data array containing calendrical as well as data entries.