info cmdtypeTcl 9.1 only
Gives the kind of the implementation of a command.
info cmdtype COMMAND
Description
Gives one word for the kind of COMMAND: proc for a proc of proc, alias for an alias of interp alias, import for a command that namespace import made, ensemble for an ensemble of namespace ensemble, interp for the command of a child interpreter, coroutine for a coroutine, object for an object of TclOO, privateObject for the command my of an object, and native for each other command.
COMMAND is looked up as a command name is: in the current namespace, then in the global namespace.
Arguments
| Argument | Type | Default | Description |
|---|---|---|---|
| COMMAND | command name | required | The command. |
Returns
One of native, proc, alias, import, ensemble, interp, coroutine, object, or privateObject.
Examples
% info cmdtype set
native
% proc p {} {}; info cmdtype p
proc
% namespace eval a {namespace export f; proc f {} {}}; namespace import a::f; info cmdtype f
import
% namespace eval e {namespace export *; proc x {} {}; namespace ensemble create}; info cmdtype e
ensemble
% oo::object create obj; info cmdtype obj
object
Errors
% info cmdtype
wrong # args: should be "info cmdtype commandName"
-errorcode TCL WRONGARGS
% info cmdtype nope
unknown command "nope"
-errorcode TCL LOOKUP COMMAND
Facts
- Capability
- None.
- Tcl release
- Tcl 9.1 only.
- Since
- ztcl 1.0.0-beta.6