Em 21/11/17 13:01, Cecil Westerhof escreveu:
> In Bash I can use ${FUNCNAME} to get the name of the current function.
> Does TCL has something like that to get the name of the current
> procedure?
>
Maybe [info frame 0]? The output is a dictionary, so this proc:
proc test {} {
puts <testStart>
set dic [info frame 0]
puts $dic
puts [dict get $dic proc]
puts <testEnd>
}
runs like:
tcl> test
<testStart>
type proc line 3 cmd {info frame 0} proc ::test level 0
::test
<testEnd>
tcl>
Or maybe something else on the [info] command, there is a lot of
introspection going on there.
(and wait some more, there a some real experts here, I am NOT one for
sure :)
--
{ricardo from
kozmate.net}