Hi, I have a problem that a "package require …" always be done into the global (::) namespace. I have a problem to setup a "namespace" from
required package to be "::test::tclmsgque::MkKernel" and *not* "::tclmsgque::MkKernel"
error: namespace import tclmsgque::* =
unknown namespace in import pattern "tclmsgque::*"
I don't know if this is a feature or a bug because without fix to global
"::" ns a package require or a lazy loading would be probably put the
package into a *wrong* ns. BUT the feature to force an other "namespace current" as global(::) for a package imported would be a benefit.
tcl code:
namespace eval test {
cmd package names
cmd namespace current
package require tclmsgque::MkKernel
cmd namespace current
cmd namespace import tclmsgque::*
…
tcl result:
package names = zlib TclOO tcl::tommath Tcl namespace current = ::test
:(tclStubsPtr->tcl_GetCurrentNamespace)(interp)->fullName<::> :ns->fullName<::tclmsgque::MkKernel>
namespace current = ::test
namespace import tclmsgque::* = unknown namespace in import
pattern "tclmsgque::*"
tcl extension C code
OT_TCL_EXTERN int
Tclmkkernel_Init (
Tcl_Interp * interp
)
{
// check for the right tcl version
if (Tcl_InitStubs (interp, "8.5", 0) == NULL) {
return TCL_ERROR;
}
if (Tcl_OOInitStubs (interp) == NULL) {
return TCL_ERROR;
}
printC(Tcl_GetCurrentNamespace(interp)->fullName)
// announce my package
LngErrorCheck (Tcl_PkgProvide (interp, "tclmsgque::MkKernel", LIBMSGQUE_VERSION ));
// toplevel namespace
Tcl_Namespace *ns = Tcl_CreateNamespace (interp,
"tclmsgque::MkKernel", NULL, NULL);
check_NULL(ns) return TCL_ERROR;
printC(ns->fullName)
…
mfg ao
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)