interp target
Gives the interpreter of the target of an alias.
interp target PATH ALIAS
Description
Gives the path of the interpreter that runs the target of the alias ALIAS in the interpreter of PATH. In ztcl the result is an empty string for a target in the current interpreter or in one of its children, and a target in an interpreter that is not the current one or below it is an error.
Arguments
| Argument | Type | Default | Description |
|---|---|---|---|
| PATH | interpreter path | required | The interpreter of the alias. |
| ALIAS | command name | required | The name of the alias. |
Returns
An interpreter path.
Examples
% set c [interp create]; interp alias $c up {} string toupper; interp target $c up
Errors
% interp target $c nope
alias "nope" in path "interp0" not found
-errorcode NONE
% interp create a; interp create b; interp alias a x b set; interp target a x
target interpreter for alias "x" in path "a" is not my descendant
-errorcode NONE
% interp target $c
wrong # args: should be "interp target path alias"
-errorcode TCL WRONGARGS
Differences from Tcl
- Tcl gives the path of the target interpreter from the current one, such as
afor a target in the childa. ztcl gives an empty string for each target in the current interpreter or below it.
Facts
- Capability
interp. A new interpreter does not have it until the host turns it on.- Tcl release
- Tcl 9.1 and 8.6.
- Since
- ztcl 1.0.0-beta.1