Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

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

Search the Archive

Re: Contexts and DumSave

  • To: mathgroup at
  • Subject: [mg54849] Re: Contexts and DumSave
  • From: "Jens-Peer Kuska" <kuska at>
  • Date: Fri, 4 Mar 2005 05:07:45 -0500 (EST)
  • Organization: Uni Leipzig
  • References: <d060us$kqa$>
  • Sender: owner-wri-mathgroup at




instead of

does not help ?

"Geronimo" <kalymereauNOSP at> schrieb im Newsbeitrag 
news:d060us$kqa$1 at
> Hi
> I have a package mypack.m in which I compute a time-consuming expression:
> BeginPackage["mypack`"]
> expr::usage="stuff"
> Begin["`Private`"]
> expr = (complicated)
> End[]
> EndPackage[]
> 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
> called.
> 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.
> Geronimo

  • Prev by Date: help browser cells inactive?
  • Next by Date: Re: Re: computing residues
  • Previous by thread: Re: help browser cells inactive?
  • Next by thread: Re: Contexts and DumSave