Standard documentation appears at http://www.purl.org/tcl/home/man/tcl8.4/TclCmd/interp.htm ---- Many newcomers to interps seem to understand them as a variant on object orientation, in that they provide a kind of encapsulation, inheritance, and ... The historical origin of interp was in "safe interpretation", that is, a mechanism for secure code evaluation. At a high level, this is what Java provides with its "sandbox", although far less flexibly and perhaps less securely. ---- [Jeffrey Hobbs] observes that, though several books ''mention'' interps, none really explains them adequately; they don't "go into enough detail for people to really understand what magic can be done. The power and flexibility of slave interpreters in Tcl is YA large advantage over other languages." (for more on Tcl's advantages, see "[How Tcl is special]") ---- [AK]'s [fmail] package nicely employs slave interpreters. ---- [Mark Roseman]'s 1996 paper [http://www.usenix.org/publications/library/proceedings/tcl96/roseman.html] on [TeamWave] explains specific interp benefits of encapsulation and security. In a conversation in mid-2001, Mark summarized, "But if you have what might be considered very coarse-grained objects that really could be conceptualized as self-contained applications, multiple Tcl interpreters are definitely an option to consider." ---- "[exit in slave interpreter]" covers a specific trickiness in interp management. ---- tkcon [http://tkcon.sourceforge.net/] is an enhanced Tk console built in pure Tcl/Tk. It makes use of slave interpreters to isolate the user environment from the tkcon environment, except through certain special commands. It makes use of many tricks with interpreter slaves. ---- Another occasionally hazardous way to think about interps is as a programming model for handling a very weak form of concurrency. Interps originated as "safe interpreters" in the [agent] work of such people as [Marshall T. Rose], ... [[Explain insights from http://groups.google.com/groups?hl=en&frame=right&th=d0e2fc9300bdbad ]] ---- '''interp alias''' can be used to do amazing things inside the same interpreter: interp alias {} = {} expr interp alias {} -> {} set res -> [= $x+1] so assignment to a default variable can be sugared (see [Euro calculator] for an application) [RS] ---- [Tcl syntax help] - [Arts and crafts of Tcl-tk programming] [Category Command]