Version 7 of info procs

Updated 2008-06-26 17:36:44 by RCN

info procs ?pattern?

If pattern isn't specified, returns a list of all the names of Tcl procedures in the current namespace. If pattern is specified, only those procedure names in the current namespace matching pattern are returned. Matching is determined using the same rules as for string match.


RCN - Why is exit not listed in info procs?

Because the exit command is not a proc.

How come renaming exit will not make it visible in info procs?

Because giving a command a new name does not convert it from a non-proc command into a proc.

puts "PROCS BEFORE: [lsort [info procs]]"

rename exit __super_exit
rename unknown __super_unknown
proc exit {{code 0}} {
    puts "Why are you leaving me :-("
    __super_exit $code
}

puts "PROCS AFTER: [lsort [info procs]]"
exit

RCN - Thanks, so I guess what you are saying is that since "exit" is not written in tcl, it will not appear in info procs. Is there an introspection way to figure out if commands or procs have been renamed? Other than wrapping rename to track rename calls.

The above code outputs:

PROCS BEFORE: auto_execok auto_import auto_load auto_load_index auto_qualify tclLog unknown
PROCS AFTER: __super_unknown auto_execok auto_import auto_load auto_load_index auto_qualify exit tclLog
Why are you leaving me :-(


See also: