Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 17bb03e5e2841af71fde4e1707170d991c4a32ea
Ticket: 98217d03e0c0032a72590b0f6af71b33d46494c6
Add option to "namespace import" command for importing also variables
User & Date: anonymous on 2015-04-25 20:54:44
Changes

  1. icomment:
    It's true. "namespace upvar" is all that I need.
    
    namespace eval moduleA::moduleB::moduleC::moduleD {		
        variable constants  { 
    		constant1 value1
    		constant2 value2
    		constant3 value3
    	}
    }
    
    namespace upvar ::moduleA::moduleB::moduleC::moduleD constants constants_str
    array set constants $constants_str
    puts $constants(constant1)
    
  2. login: "anonymous"
  3. mimetype: "text/plain"