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: Don Porter <dgp@email.nist.gov>
Date: Wed Mar 08 2006 - 03:14:06 CET

sbromle <sam@sambromley.com> wrote:
>> 2) Remove any new Tcl object types that have been defined (is this
>> possible?)
 
Adrian Ho wrote:
> You want to use Tcl_DecrRefCount() for this, methinks.

No, that's a completely different topic.

Once you register a Tcl_ObjType with Tcl_RegisterObjType(), you're
stuck. You won't be able to [unload] that extension.

The solution? Don't call Tcl_RegisterObjType().

There's no need to register your Tcl_ObjType in order to use it to
your heart's content within your extension, and the Tcl_ObjType need
not be registered in order to pass through the core.

It turns out that there are very few situations where registering the
Tcl_ObjType with the core has any value. Just don't do it, at least
not until experience has convinced you there's something you just can't
accomplish without doing so.

-- 
| Don Porter          Mathematical and Computational Sciences Division |
| donald.porter@nist.gov             Information Technology Laboratory |
| http://math.nist.gov/~DPorter/                                  NIST |
|______________________________________________________________________|
Received on Sun Apr 30 02:26:46 2006