Uplevel

Uplevel

"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 } }

Wikimedia Foundation. 2010.

Игры ⚽ Нужно сделать НИР?

Look at other dictionaries:

  • Subaru Legacy — Infobox Automobile name = Subaru Legacy aka = Subaru Liberty Subaru B4 Subaru Legacy B4 Subaru Legacy Touring Wagon manufacturer = Subaru predecessor = none parent company = Fuji Heavy Industries production = 1989 present class = Mid size (1989… …   Wikipedia

  • AMC Ambassador — Infobox Automobile manufacturer=American Motors Corporation assembly=Kenosha, Wisconsin layout=FR layout production=1958 1974 class=Mid size name=AMC AmbassadorThe Ambassador was the top line automobile produced by the American Motors Corporation …   Wikipedia

  • Pontiac Grand Am — Infobox Automobile name = Pontiac Grand Am manufacturer = General Motors production = 1973 1975 1978 1980 1985 2005 body style = 2 door coupe 4 door sedan predecessor = Pontiac LeMans/GTO (for 1973) Pontiac Phoenix (for 1985) successor = Pontiac… …   Wikipedia

  • Tcl — Запрос «TCL» перенаправляется сюда; о минидистрибутиве Linux см. Tiny Core Linux. Tcl Семантика: императивный …   Википедия

  • TCL — Семантика: императивный, скриптовый Тип исполнения: интерпретатор Появился в: 1988 г. Автор(ы): Джон Остераут Последняя версия: 8.5.7 / 15 апреля 2009 …   Википедия

  • Tcl — Infobox programming language name = Tcl paradigm = multi paradigm: object oriented, functional, procedural, event driven programming year = 1988 designer = John Ousterhout developer = John Ousterhout latest release version = 8.5.4 latest release… …   Wikipedia

  • Chevrolet Impala — 1958 Chevrolet Impala Coupe Manufacturer Chevrolet Division of General Motors Production …   Wikipedia

  • Buick Electra — 1977 Buick Electra coupe Manufacturer General Motors Also called Buick Electra 225 Buick Electra 225 Custom Buick Electra 225 Limited Buick Electra Limited Buick Electra Park Avenue …   Wikipedia

  • Nissan Altima — Manufacturer Nissan Production 1993–present Predecessor Nissan Stanza …   Wikipedia

  • Chevrolet C/K — Manufacturer General Motors Also called GMC C/K GMC Sierra Production 1960–2000 United States 1965–2000 Canada 1964–2001 Br …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”