The two remaining forms are related
to command scripts. »list« is the preferred
form. »list« is context free, whereas »subst« is
not.
Jeszra has to resort to subst for consecutive
commands. Such as an additional »break« inside an
event binding. It is safer to use single commands
and thus avoiding »subst«.
-command [list doSomethingWith $base]
...
bind $base$w(1) <1> [subst {
doSomethingWith $base$w(2);
break;
}]
...
proc eventBreakDoSomethingWith window {
doSomethingWith $window;
return -break
}
bind $base$w(1) <1> \
[list eventBreakDoSomethingWith $base$w(2)]
Jeszra tries to avoid both forms. »list«
and »subst« are usually used for
variable
substitutions.
Typical
situations are references to window path names
–as seen in the code fragment above– through
variables ($base, $base$w(n)).
Variable substitutions are auto-generated by
Jeszra. The variable substitution occurs
for every window path name used inside of a
command property or event handler.
.my.window ➟ $base$w(1)
.my ➟ $base$w(0)
.window := contents of template
variable »w« with index 1.