basic extensions to tcl6.4 to add user defined call frame capabilities. Extensions take the form of a new command to create call frames as well as an extension to the upvar and uplevel command syntax. varframe create #foo ---------------- Creates a new call frame called "foo". Initially foo has no variables set. varframe delete #foo ---------------- Removes variable frame called foo as well as all variables in the frame. varframe exists #foo ---------------- Returns 1 if frame #foo exists or 0 otherwise. varframe find b ---------------- Lists all user defined call frames which contain a variable named b. varframe get #foo var ?var ...? ---------------- Returns a list of the values of the specified variables in #foo. varframe list ---------------- Lists all user defined call frames. varframe set #foo var value ?var value ...? ---------------- Assigns values to the specified variables in #foo varframe vars #foo ---------------- Lists all variables defined in #foo. upvar #foo a1 a2 ---------------- Makes the variable a2 in the current frame be an alias for the variable a1 in #foo. upvar #foo all ---------------- Installs aliases in the current frame for all the variables in the frame #foo. This is useful for "object oriented" style programming using frames as primitive objects. For example: proc bar {obj} { upvar $obj all # all variables in $obj are available now } upvar #?a1 a1 a2 ---------------- Makes the variable a2 in the current frame be an alias for the variable a1 in the first call frame found which contains the variable a1. The search starts at the current frame and proceeds up the call stack, ending at the global frame. This provides a primitive form of dynamic variable scope. For example: proc foo1 {} { upvar #?a a a echo $a } proc foo2 {} { set a 10 foo1 } foo2 will print 10.