Re: Compound expression and order of evaluation



jo@xxxxxxxxxxxxxxxx wrote:
Can anybody confirm for that in the following code, that the regsub
expression is always evaulated first, so that I can be certain that
Extras will always be correctly set? I've looked on the Wiki and in
"Practical Programming" but I cannot find the answer.
...
if {([regsub -all {[0-1]} $BitMap "" Extras] == $LengthCheck) &&
([string length $Extras] == 0)} {

Yes, order of evaluation is left to right in Tcl expressions and does proper short-circuiting.

Jeff
.