Skip to content
Tcl Source Code View Ticket
Login

View Ticket

expr command not substituting operator

Closed / Invalid218310ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 00:55:59
OriginalBugID: 3697 Bug
Version: 8.2
SubmitDate: '1999-11-29'
LastModified: '1999-11-29'
Severity: LOW
Status: Closed
Submitter: techsupp
ChangedBy: hobbs
OS: Windows NT
OSVersion: Windows NT 4
FixedDate: '2000-10-25'
ClosedDate: '1999-11-29'


Name:
Jay Schmidgall

ReproducibleScript:
set opr +
set x 5
set y 15
expr $x $opr $y   ;# this works
expr {$x $opr $y} ;# this doesn't work

ObservedBehavior:
The line which doesn't work gives the error:

syntax error in expression "$x $opr $y"

DesiredBehavior:
I would expect to get the answer, 15.



expr needs to know about operators ahead of time (early
error detection), which is why the first, which does one
level of substitution first, works. 
-- 11/29/1999 hobbs
welch Closed ticket [218310ffff]. [History diff]2000-10-26 08:19:00
dgp Ticket [218310ffff]: 4 changes [History diff]2001-04-19 02:48:18
Log in (anonymous is fine) to add a comment.