Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*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

Reloading packages: Removed[symbol]

  • To: mathgroup at smc.vnet.net
  • Subject: [mg57791] Reloading packages: Removed[symbol]
  • From: Josef Karthauser <joe at tao.org.uk>
  • Date: Wed, 8 Jun 2005 03:21:42 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

I want to reload a package that's already been loaded.  (Because it's
been modified in another mathematica session and I want to take
advantage of the new functionality.)

I thought I was being clever by first removing all the package symbols
with Remove[] and then removing the package name from $Packages.  This
allows me to reload the package, but I'm left with a dilemma.
Definitions that are in memory that referenced the symbols that have
been removed have been replaced with 'Removed["symbol"]' and I can't
seem to match them to turn them back.

Is there a way of reloading a module?  How do I fix this problem?

The string of operations to reload MyPackage was:

    Remove["MyPackage`*"]

    Unprotect[$Packages];
    $Packages = Select[$Packages, =AC StringMatchQ[#, "MyPackage`*"] &];

    Needs["MyPackage`"]

My problem now is effectively:

    In: a = MyPackage`Foo[]
    In: Remove["MyPackage`*"]
    In: a // FullForm
    Out: Removed["Foo"][]

How do I convert a back?

    In: a /. Removed[x_] :> Symbol[x]

Doesn't do anything :(.

Joe
--
Josef Karthauser (joe at tao.org.uk)	       http://www.josef-k.net/
FreeBSD (cvs meister, admin and hacker)     http://www.uk.FreeBSD.org/
Physics Particle Theory (student)   http://www.pact.cpes.sussex.ac.uk/
================ An eclectic mix of fact and theory. =================



  • Prev by Date: Re: Centering of graphics
  • Next by Date: Re: NIntegrate
  • Previous by thread: Re: Centering of graphics
  • Next by thread: Re: Reloading packages: Removed[symbol]