Skip to content
Tcl Source Code View Ticket
Login

View Ticket

spaces in compiled expressions

Closed / Invalid587145ffffffffffffffffffffffffffffffffffCreated 24 years agoUpdated 24 years ago
Descriptionplain2002-07-26 17:22:28
% set x {+ 1}
+ 1
% expr {$x + 1}
can't use non-numeric string as operand of "+"
% expr $x + 1
2
andreas_kupriesplain2002-07-27 00:27:43
Logged In: YES 
user_id=75003

This is not a bug but the expected behaviour. $x is a non-
numeric string, and braced expressions $x is a atom in the 
expression, and not interpolated into it. This is also the 
difference between

set op +
expr {1 $op 3}    (a)
expr 1 $op 3

op is not recognized in (a).
hobbsplain2002-07-27 00:28:47
Logged In: YES 
user_id=72656

I concur with aku.
Log in (anonymous is fine) to add a comment.