Re: Can one "reload" a package?
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.tcl archive

Re: Can one "reload" a package?

From: Georgios Petasis <petasis@iit.demokritos.gr>
Date: Tue Mar 07 2006 - 17:29:11 CET

Tcl core offers the unload command, which can be used to
unload a C extension, previously loaded with load, IF the
C extension has been maded unloadable (i.e. have the proper
functions in place). However,
you have to use tcl 8.5. See http://wiki.tcl.tk/10852

George

"sbromle" <sam@sambromley.com> wrote in message
news:1141747942.069943.90010@i40g2000cwc.googlegroups.com...
> Hi folks,
> Thanks in advance for any insight you could
> give on this problem. I hope that this may be
> of interest to others on the list as well.
>
> I have an application which support plugins.
> These plugins can be reloaded at any time
> and their state is preserved in the "core" application.
> This allows me to actively develop a plugin
> and to test the results of any changes and compare
> it to the previous version, without restarting
> the main application.
>
> So now I'm beginning to push the core application
> beyond it's original intent,
> and I figure the best way to do this is to give
> it the power and scriptability that Tcl provides.
> Ideally, I'd like to make each plugin a Tcl Package,
> and then be able to ask for the core application
> to reload a package if I modify it.
>
> Looking at the "load" command doc, it looks like
> unloading is impossible. Is anyone aware of an alternative
> method that I can use to get this effect?
>
> The way I do it in C is to have all the plugins dynamically
> loadable shared libraries, which register themselves and the
> commands they provide (a la Tcl Packages I guess.) But in C,
> I can just close the library, deregister the commands, and reopen
> the new one.
>
> Any help, comments, and suggestions would be greatly appreciated!
>
> Thanks,
> Sam.
>
Received on Sun Apr 30 02:25:53 2006