Questions tagged [uplevel]
The uplevel tag has no usage guidance.
uplevel
11
questions
1
vote
1
answer
102
views
Tcl's foreach not setting variables
I'm redefining Tcl's set command to allow multiple assignments at once. However, once I try to use the variables, it reports an "undefined variable" error. Here are the two ways I've tried ...
0
votes
1
answer
214
views
TCL - invalid command name ... but different
I try to add two buttons to the console window for convenience and to play around with it.
The problem is: The first button just triggers an "exit". This works fine.
The second button ...
0
votes
0
answers
86
views
Does Python 3.8 has an equivalent of TCL uplevel
This is equivalent to the question asked about Python 2.5 here.However, I am interested if this functionality has been added in Python 3.8., or beforehand.
0
votes
2
answers
383
views
Tcl upvar and uplevel in performance
Let's say I have a variable which is one level up, which I just want to query its' value. I have two options:
uplevel { set var_name }
Or:
upvar var_name
If I need to query the variable just once, and ...
0
votes
0
answers
35
views
What's the concept of UPLEVEL operator?
I'm not an expert in databases and I've just worked with MySQL database so far. I'm familiar with SELECT, INSERT, UPDATE, DELETE statements. Also as you know, there is lots of information about them ...
0
votes
2
answers
1k
views
Variable substitution within braces in Tcl
Correct me wherever I am wrong.
When we use the variables inside braces, the value won't be replaced during evaluation and simply passed on as an argument to the procedure/command. (Yes, some ...
2
votes
1
answer
712
views
What is the difference between a TCL namespace and a stack frame?
Upvar creates a link to a variable in a different stack frame, sometimes called a call stack, or a different scope.
Upvar is also used to create an alias for a global (or namespace) variable 2. But ...
0
votes
1
answer
273
views
tcl Uplevel set command fails when value has multiple words
All,
What i am trying to do: Proc A calls Proc B, Using uplevel command from B i am trying to set variable in proc A scope. Error occurs when the value has spaces.
proc B { } {
set string1 "Test"...
1
vote
4
answers
1k
views
How to evaluate a tclsh script?
tclsh is a shell containing the TCL commands.
The TCL uplevel command evaluates the given TCL script, but it fails to evaluate a tclsh script (which can contain bash commands).
How can I obtain an ...
3
votes
2
answers
1k
views
does python 2.5 have an equivalent to Tcl's uplevel command?
Does python have an equivalent to Tcl's uplevel command? For those who don't know, the "uplevel" command lets you run code in the context of the caller. Here's how it might look in python:
def foo():
...
6
votes
2
answers
645
views
How to localize a variable in an upper scope in Perl?
I have run across the following pattern a few times while developing Perl modules that use AUTOLOAD or other subroutine dispatch techniques:
sub AUTOLOAD {
my $self = $_[0];
my $code = $self-...