Posted to tcl by lyon at Tue Feb 19 19:50:17 GMT 2013view raw
- # proc F {} {}
- proc test {} {
- set script {
- proc F {call} {
- puts stdout "$call -> [namespace current]"
- }
- }
- #
- namespace eval ::A {}
- namespace eval ::A [subst {
- $script
- F 1
- }]
- #
- namespace eval ::A::B {
- namespace path ::A
- }
- namespace eval ::A::B [subst {
- $script
- F 2
- }]
- #
- namespace eval ::A::B {
- F 3
- }
- }
- test