braces required on expression in while statements - not docu
Closed / Invalid218042ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 00:52:30
OriginalBugID: 1364 Bug
Version: 8.0.4
SubmitDate: '1999-03-02'
LastModified: '1999-08-07'
Severity: MED
Status: Closed
Submitter: pat
ChangedBy: hobbs
OS: Solaris
OSVersion: 2.6
Machine: Other
FixedDate: '2000-10-25'
ClosedDate: '1999-08-07'
Name:
Raj
Extensions:
many
ReproducibleScript:
The code
while [doSomething] {
...
}
used to work with tcl8.0, where the proc "doSomething" gets evaluated prior to every iteration. For some reason, it needs braces around the expression in
tcl8.0.4. I found it the hard way after one of my programs ran into an infinite loop. I don't know where the extra round of substitution crept into ver 8.0.4. Also, no information regarding this effect is mentioned in any of the release documentation.
DesiredBehavior:
proper documentation of changes.
The fact that it was not required in earlier 8.0 releases was the
bug. According to the rules of substitution, the above becoming
an infinite loop is the stated behavior. It would be eval'ed only
once (let's say to true), and then that is cached for later iterations.
Placing the {}s around the conditional are required to make sure it
will be evaluated at every iteration.
-- 08/07/1999 hobbs
welch Closed ticket [218042ffff].
[History diff]2000-10-26 08:13:43
dgp Ticket [218042ffff]: 4 changes
[History diff]2001-04-16 23:45:17
Log in (anonymous is fine) to add a comment.