Re: Button with incremented number
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.tcl archive

Re: Button with incremented number

From: Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at>
Date: Thu Jun 02 2005 - 10:39:46 CEST

Michael Pachta <mipani@gmx.de> wrote:
> But let's see what I learned:
> 1) "..." - immediate substitution of all variables
With "variables" you surely mean those with a $ in front.
same goes for command-substitution [blabla ...]

> 2) {...} - delayed subst. of variables
delayed? it depends on what you do with that thing.

If you later execute it some way (-command, eval, if, while, proc, ...)
then yes, it will be substed delayed. if you do not execute it
but perhaps only use it for -text, then it will be never substed.

All the rules about "will be substed" or "will not be .." are
always focused on the step of putting together the thing to
execute. What happens during execution is beyond the scope
of these rules.

e.g.
set var {puts $foo}
if 1 {puts $var}

In both cases, no substitution happens *during parsing the command*,
but the if conmmand then does another round on its second argument,
so you will see the value of $var , namely 'puts $foo' printed out.

> 3) {...{$...}...} - no subst. of variables inside the inner braces
eval { if 1 { puts $var } }
Received on Thu Sep 29 14:19:58 2005