proc dump {{text {}}} {
    set text [uplevel 1 [list subst $text]]
    set l [expr {[info level] -1}]
    if {$text eq {}} {
	set text [info level $l]
    }
    puts "$l: $text"
}
# proc dump args {}
proc bravo {} {
    upvar 1 v w
    dump {inside bravo, v -> $w}
    set v "procedure bravo"
    uplevel 1 [list delta ::betty]
    return $::resolution
}
proc delta name {
    upvar 1 v w
    dump {inside delta, v -> $w}
    set v "procedure delta"
    tailcall foxtrot
}
proc foxtrot {} {
    upvar 1 v w
    dump {inside foxtrot, v -> $w}
    global resolution
    set ::resolution $w
}
set v "global level"
set result [bravo]
if {$result ne $v} {
    puts "v should have been found at $v but was found in $result"
}
