Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: b3074135e8d0d3a1ab91399a74ebaf8e6f882c33
Ticket: 1068332fffffffffffffffffffffffffffffffff
Tcl_GetCurrentNamespace doesn't work properly
User & Date: nobody on 2004-11-17 22:59:47
Changes

  1. assignee changed to: "dgp"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    I'm using Tcl 8.4.6 but it seems to exists also in later versions. 
    My system is Linux 2.6.8.1, Slackware Current, Duron 800. 
     
    I'm maintaining TCL module for Polish Instant Messager called 
    Kadu. I want to use namespaces to separate loaded scripts from 
    each other. I define [on] command at C++ level and I need to 
    know what is the current namespace, while executing this 
    command, so I use Tcl_GetCurrentNamespace() to get it, but it 
    always returns "::". 
     
    Now, you'll propably ask - why I'm sure that it SHOULD be different 
    namespace than "::"? Well, I load script which is only one line and 
    looks like: 
     
    on connected some_proc 
     
    and my module loads it by code: 
     
    int status = Tcl_VarEval(interp, 
        "namespace eval ", last, " {", 
            data, 
        "}", NULL); 
     
    where 'last' is char* type and contains namespace for this script, 
    'data' is also char* type and contains script code data, which is the 
    above line in this case. So, when I call [on] in this one line, I 
    should get 'last' value by calling Tcl_GetCurrentNamespace inside 
    of [on], am I right? It returns to me "::". That's the point. 
     
    Googie, my e-mail is boogie (at) scripts.one.pl 
    
  4. foundin changed to: "obsolete: 8.4.6"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "nobody"
  9. subsystem changed to: "50. Embedding Support"
  10. title changed to: "Tcl_GetCurrentNamespace doesn't work properly"
  11. type changed to: "Bug"