Richard Suchenwirth - Tcl is the Tool Command Language. Execution is done by splitting scripts into commands (by newline or semicolon). A command is a sequence of words, the first being the command name, the rest its arguments. (So far from Tcl syntax). A specialized mantra would say "everything is a command", even what other languages call "control strucutures" (if, while, for...) or "declarations" (global, proc, variable...).
All available command names at a given time (and namespace) are returned by
info commands
They may have come from several sources:
The following proc returns the type of a command, or an empty string if the name is not a command:
proc command'type2 name { foreach {result condition} { unsourced {[info command $name]=="" && [info ex ::auto_index($name)]} {} {[info command $name]==""} proc {[info proc $name]==$name} alias {[lsearch [interp aliases {}] $name]>=0} image {[lsearch [image names] $name]>=0} widget {[winfo exists $name]} command 1 } {if $condition {return $result}} } ;# RS
To introspect commands in other than the current namespace, walk the tree with namespace children.