Re: Package unloading
- From: Donald G Porter <dgp@xxxxxxxx>
- Date: Wed, 30 Jan 2008 10:57:00 -0500
Derek Fountain wrote:
I have a package containing a file call foo.tcl, which contains a whole bunch of Tcl procedures I'm working on. I start a tkcon, package require mypackage, do my thing, then go back to my editor for further work on foo.tcl. Then I run 'make install' to get the latest foo.tcl into place.
Then, I need to exit tkcon and restart it, and package require again to get the latest Tcl code into the interpreter. Is there a way I can unload foo.tcl and reload it from disk without restarting the interpreter?
Your question is confusing.
What is the relationship between the file "foo.tcl" and the package
"mypackage" ?
[package forget mypackage] will reset the interp to no longer know it
contains the "mypackage" package and to also forget anything it knows about what versions of "mypackage" are available. Then the next [package require mypackage $requirement] will bring in the most suitable version of mypackage available satisfying $requirement, with a fresh call to [package unknown] to figure that out.
The exact effect of [package require]-ing a new version of "mypackage"
over the top of its [package forg<o>t]ten predecessor depends on the
details of how "mypackage" is written.
--
| Don Porter Mathematical and Computational Sciences Division |
| donald.porter@xxxxxxxx Information Technology Laboratory |
| http://math.nist.gov/~DPorter/ NIST |
|______________________________________________________________________|
.
- Follow-Ups:
- Re: Package unloading
- From: Derek Fountain
- Re: Package unloading
- References:
- Package unloading
- From: Derek Fountain
- Package unloading
- Prev by Date: Re: Package unloading
- Next by Date: Re: Why doesn't foreach return a value
- Previous by thread: Re: Package unloading
- Next by thread: Re: Package unloading
- Index(es):
Relevant Pages
|