Uplevel
This article may not meet the general notability guideline. Please help to establish notability by adding reliable, secondary sources about the topic. If notability cannot be established, the article is likely to be merged, redirected, or deleted. (August 2009) |
Uplevel is a command in Tcl that allows a command script to be executed in a scope other than the current innermost scope on the stack. Because the command script may itself call procedures that use the uplevel command, this has the net effect of transforming the call stack into a call tree.
It was originally implemented to permit Tcl procedures to reimplement built-in commands (like for, if or while) and still have the ability to manipulate local variables. For example, the following Tcl script is a reimplementation of the for command (omitting exception handling):
proc for {initCmd testExpr advanceCmd bodyScript} { uplevel 1 $initCmd set testCmd [list expr $testExpr] while {[uplevel 1 $testCmd]} { uplevel 1 $bodyScript uplevel 1 $advanceCmd } }
File:HelloWorld.svg | This programming language-related article is a stub. You can help Wikipedia by expanding it. |
If you like SEOmastering Site, you can support it by - BTC: bc1qppjcl3c2cyjazy6lepmrv3fh6ke9mxs7zpfky0 , TRC20 and more...
- Articles lacking sources from December 2009
- Articles with invalid date parameter in template
- All articles lacking sources
- Pages with broken file links
- Articles with topics of unclear notability from August 2009
- All articles with topics of unclear notability
- Programming language topics
- Programming language topic stubs