beetlebug▾
/

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

ArgumentTypeDefaultDescription
PATHinterpreter pathrequiredThe interpreter of the alias.
ALIAScommand namerequiredThe 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

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

See also