On Mon, 1 Apr 2002 22:35:41 +0200, Jean-Claude Wippler <[EMAIL PROTECTED]> wrote:

>The segfault is bad of course, but there may be multiple issues here.
>
>Note that MK defines a mk::set command.  So please change from:
>    namespace eval ::mk {set n [namespace current]}
>to:
>    namespace eval ::mk {::set n [namespace current]}
>As I assume that is what you intended?

Yep, that certainly makes the error make sense.  Qualifying the set command
fixes that problem.

But AOLServer still doesn't like namespaces.  In particular, commands (not
procedures) defined in a namespace.  They seem to get lost and I haven't yet
found a way to get to them through 'namespace import' or anything like that.

So I tried an alternate approach, again using renaming:  this time, I
changed the mk4tcl code to create commands named __mk__file and so forth,
then from a startup file create tcl procedures ::mk::file et al.  Since they
are procedures, they get recreated in the namespace.  However, attempting to
use them gets back an error "Initialization error in dispatcher".  I think
whats going on here is that mk4tcl creates a bunch of c++ objects on
initialization and registers an exit procedure to clean those up when the
tcl interpreter is destroyed; however AOLserver creates an interpreter for
startup and then destroys it and creates more when necessary, so mk4tcl is
left with references to destroyed objects.  If this is correct, then either
mk4tcl (or the hypothetical aolserver version, ns_metakit) would need to
call the initialization procedure for each new interpreter (or otherwise
when necessary) or not register the exit procedure.

The namespace thing still bugs me tho.

-J

Reply via email to