beetlebug▾
/

interp invokehidden

Runs a hidden command of an interpreter.

interp invokehidden PATH NAME ?ARG ...?

Description

Runs the hidden command NAME of the interpreter of PATH with the ARG words, and gives its result. The command runs in that interpreter, so a set sets a variable of the child.

Arguments

ArgumentTypeDefaultDescription
PATHinterpreter pathrequiredThe interpreter.
NAMEstringrequiredThe name of the hidden command.
ARGstringnoneAn argument of the command.

Returns

The result of the hidden command.

Examples

% set c [interp create]; interp hide $c set; interp invokehidden $c set a 5
5

% interp expose $c set; interp eval $c {set a}
5

Errors

% interp invokehidden $c nope
unknown hidden command "nope"
-errorcode NONE

# ztcl reads no option, so -global is the name of the command.
% interp invokehidden $c -global set b 1
unknown hidden command "-global"
-errorcode NONE

% interp invokehidden $c
wrong # args: should be "interp invokehidden path ?-option ...? hiddenCmdName ?arg ...?"
-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