[EMAIL PROTECTED] wrote:
On Apr 19, 2006, at 5:38 AM, Nis Jorgensen wrote:
John Buckman wrote:
HOWEVER, Jeremy wrote:
You could throw the handle name into a namespace variable. They don't
currently get cleaned up.
and he's absolutely right, as code like this:
catch {namespace eval space {}}
catch {adp_puts $space:x}
set space:x 1
works as expected. So, Jeremy's tip to put per-interpreter globals into
a namespace is an elegant work-around.
Disagree about the "elegant" part. I find the fact that ::foo is cleaned
up, while ::bar::foo isn't counterintuitive, and something I would
change "in a perfect world". Suggesting that people rely on this
behavior makes it harder to change in the future.
How can you know exactly what variables to clean up in each
namespace? Even the cleanup for the global namespace doesn't
completely wipe out all variables.
This is exactly the problem we ran into when thinking about how we could
better support Tcl namespace variables in AOLserver 4.5. The short
answer is that there doesn't necessarily seem to be a good way to do
this automatically for you, and instead it will be up to each developer
to delete the namespace variables they have created:
ns_ictl trace deallocate {... your cleanup here ...}
In AOLserver 4.5 the callbacks have been cleaned up and now fire in the
right order, lifo for cleanups, fifo for inits. Hope that helps!
- n
- Jeremy
--
AOLserver - http://www.aolserver.com/
To Remove yourself from this list, simply send an email to
<[EMAIL PROTECTED]> with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the
Subject: field of your email blank.
--
AOLserver - http://www.aolserver.com/
To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]>
with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject:
field of your email blank.