Version 4 of info procs

Updated 2008-06-26 04:25:08 by dgp

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 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

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:


Category Command - Tcl syntax help