set factor 8000

set s {}
for {set i 0} {$i<$factor} {incr i} {append s "$i "}
# This is quite a nasty way to write a proc, but that's the way it goes...
proc pstack {} {
    set l [info level]
    puts "\[global level\]"
    for {set i 1} {$i<$l} {incr i} {
	# Can't use [string repeat] since want to work with 8.0
	puts [format %*s%s $i "" [info level $i]]
    }
}
proc B {args} [format {
    list %s
    for {set i 0} {$i<%d} {incr i} {append tmp ,->$i}
    pstack
    puts [string length $tmp]
} $s $factor]
proc A {args} {
    puts A=[info level]=[info level 0]
    B some random args
    puts A=[info level]=[info level 0]
}
A foo bar spong wibble
