beetlebug▾
/

interp expose

Makes a hidden command of an interpreter visible again.

interp expose PATH NAME ?CMD?

Description

Makes the hidden command NAME of the interpreter of PATH a command that its scripts can call, with the name CMD, or NAME with no CMD.

Arguments

ArgumentTypeDefaultDescription
PATHinterpreter pathrequiredThe interpreter.
NAMEstringrequiredThe name of the hidden command.
CMDcommand namenoneThe new name of the command, NAME by default.

Returns

An empty string.

Examples

% set c [interp create]; interp hide $c set; interp expose $c set; interp eval $c {set a 1}
1

% interp hide $c set hs; interp expose $c hs put; interp eval $c {put b 2}
2

Errors

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

% interp expose $c
wrong # args: should be "interp expose path hiddenCmdName ?cmdName?"
-errorcode TCL WRONGARGS

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