tcl-quill 0.3.0: Quill Project Automation System for Tcl/Tk

smartinterp(n): Smart Tcl Interpreter -- quill(n)

SYNOPSIS
DESCRIPTION
COMMANDS
INSTANCE COMMAND
AUTHOR

SYNOPSIS

package require quill 0.3.0
namespace import ::quill::*
smartinterp obj ?options?
obj cget option
obj configure ?options...?
obj eval args...
obj alias srcCmd ?targetCmd? ?args?
obj proc name arglist body
obj clone srcProc targetProc
obj ensemble name
obj smartalias name syntax minArgs maxArgs prefix

DESCRIPTION

smartinterp(n) is the object type which wraps standard Tcl interp's and provides additional ways to define commands within them.

COMMANDS

smartinterp(n) defines the following commands:

smartinterp obj ?options?
Creates a new smartinterp(n) object called obj. Each smartinterp(n) object wraps a single Tcl interpreter. If obj is %AUTO%, smartinterp(n) will choose an object name automatically. Either way, the new object's name is returned.

smartinterp(n) objects may be created with the following options:

-commands set
The set is all, safe, or none: all standard commands (the default), only safe commands, or no commands at all. This option is read-only after the object is created.

INSTANCE COMMAND

Each instance of smartinterp(n) has the following subcommands.

obj cget option
Returns the value of the named option.

obj configure ?options...?
Sets the value of one or more options.

obj eval args...
Evaluates its args in the smartinterp(n)'s slave interpreter. The semantics are identical to the eval subcommand of a standard Tcl interpreter.

obj alias srcCmd ?targetCmd? ?args?
Aliases the targetCmd (with any specified args) into the smartinterp(n) as srcCmd. The arguments and semantics are as for the alias subcommand of a standard Tcl slave interpreter.

obj proc name arglist body
Defines a proc in the context of the interpreter. Calling this command is equivalent to passing a proc definition to eval.

obj clone srcProc targetProc
Retrieves the definition of the targetProc in the caller's context, and defines it in the slave interpreter under the name srcProc. If srcProc contains namespace information, the relevant namespaces must already exist in the slave interpreter.

obj ensemble name
Defines an ensemble to which smart aliases (and sub-ensembles) can be attached. If name is a list, the first (n-1) elements must be the name of a previously defined ensemble.

obj smartalias name syntax minArgs maxArgs prefix
Defines a "smart" alias, an alias with improved standard error messages. The name is the name of the command within the slave interpreter; if name is a list, the first (n-1) elements must be the name of an ensemble.

The syntax should be the command's syntax, shown in usual Tcl style, excluding the name. The minArgs is the minimum acceptable number of arguments, and maxArgs is the maximum acceptable number of arguments, or "-" if there is no maximum.

The prefix is the command prefix of which the alias is an alias.

If a smart alias is used, then "wrong # args" error messages will reflect the alias name rather than the name of the command to which it is aliased. Further, calling an ensemble alias without a subcommand or with an incorrect subcommand will also result in appropriate error messages.

AUTHOR

Will Duquette.


Generated from smartinterp.manpage on Sat Nov 08 09:38:04 PST 2014