info level
来源:互联网 发布:k means java实现 编辑:程序博客网 时间:2024/06/06 03:52
What mean about the level number of "info level"?
proc arginfo {} {
set proc [lindex [info level -1] 0]
puts "/[[info level]/]"
puts "info level 0 = /[[info level 0]/]"
puts "info level 1 = /[[info level 1]/]"
puts "info level 2 = /[[info level 2]/]" #test the number after info level mean
#info level number中的number只可能是0,-1,1,2.
#0代表当前procedure
#-1代表调用目前procedure的procedure
#1代表调用目前procedure的最高的那层procedure
#2代表当前procedure所调用的procedure?还有疑问,如果当前procedure调用多个procedure呢?需作试验
puts "proc=$proc"
set which [uplevel [list namespace which -command $proc]]
puts "which=$which"
puts "proc /[$which/]"
set i -1
foreach arg [info args $which] {
incr i
set value [uplevel [list set $arg]]
puts "value=$value"
if { [info default $which $arg def] } {
puts " arg/[$i/] /[$arg/] = /[$value/] default = /[$def/]"
} else {
puts " arg/[$i/] /[$arg/] = /[$value/]"
}
}
}
proc test {foo {"bar baz" "BAR BAZ"}} {
arginfo
}
结果:
% test a b
[2]
info level 0 = [arginfo]
info level 1 = [test a b]
info level 2 = [arginfo]
proc=test
which=::test
proc [::test]
value=a
arg[0] [foo] = [a]
value=b
arg[1] [bar baz] = [b] default = [BAR BAZ]
- info level
- info
- info
- Info
- info
- info
- Info
- info
- info
- info
- Info
- INFO
- INFO
- INFO: Header and Library Requirement When Set/Get Socket Options at the IPPROTO_IP Level
- Icon specified in the Info.plist not found under the top level app wrapper:XXXX.png
- Icon specified in the Info.plist not found under the top level app wrapper:解决办法
- message info
- mysqli info
- GCC/MAKE使用笔记
- POJ 3169 Layout(差分约束系统)
- 电源管理
- Webware_ASP.NET_CMS
- jquery 的dialog 总结
- info level
- oracle新建normal账号时,不能登录的原因是在用户名上加了双引号
- 邀请你加入“魔教”微群 -- 有个小礼物给朋友们
- C#自动属性
- Windows环境下使用VS2005编译OpenSSL
- CSDN第一文:感谢~· O(∩_∩)O哈哈~
- 中文编码转换成Unicode16进制编码
- 鼠标的滚轮javascript事件
- 安装和破解flash builder和flash cs5的注意事项