Updated 2016-09-06 10:13:21 by pooryorick

namespace inscope executes a script in the context of namespace.

Synopsis  edit

namespace inscope namespace script ?arg ...?

Desciption  edit

Each arg is quoted so that no further substitutions are performed on it, and is appened as an additional word of the final command in script, and then script is passed to the interpreter for evalation in namespace.

namespace inscope ::foo $script $x $y $z is equivalent to namespace eval ::foo [concat $script [list $x $y $z]].

In contrast with namespace eval, namespace must already exist.

namespace inscope is not expected to be used directly by programmers. Rather, namespace code generates a namespace inscope command that, when evaluated, executes script in the context of namespace. The result of namespace code is often passed to Tk commands that arrange for scripts to be evaluated in response to events.

Like namespace eval, namespace inscope adds a level to the interpreter. apply and tailcall, provide a way to do what namespace inscope does, but without adding a level.