Menu

#1995 spaces in compiled expressions

closed-invalid
5
2002-07-26
2002-07-26
No

% set x {+ 1}
+ 1
% expr {$x + 1}
can't use non-numeric string as operand of "+"
% expr $x + 1
2

Discussion

  • Andreas Kupries

    Andreas Kupries - 2002-07-26

    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).

     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2002-07-26

    Logged In: YES
    user_id=72656

    I concur with aku.

     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2002-07-26
    • status: open --> closed-invalid