Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: dfc886025052a25061d597138d03e9d4c98b1e14
Ticket: 545661ffffffffffffffffffffffffffffffffff
bug in expr error handler
User & Date: msofer on 2002-04-18 13:59:02
Changes

  1. assignee changed to: "msofer"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    There is an inconsistent behaviour in the [expr] error
    handler: the moment when an invalid operand is detected
    and an error is raised depends on the evaluation path
    of the expression (compiled at compile-time vs at
    run-time):
    
    % set a 08
    08
    % expr $a - 1
    "08" is an invalid octal number
    % expr {$a - 1}
    can't use invalid octal number as operand of "-"
    
    The compiled-at-run-time version seems not to respect
    the  expr.n manual page, which states:
    "If no numeric interpretation is possible, then an
    operand is left as a string (and only a limited set  of
    operators may be applied to it)."
    
    % set a 08
    08
    % expr $a == 1
    "08" is an invalid octal number
    % expr {$a == 1}
    0
    
    See also the (off-topic?) comments in [Bug #542588].
    
  4. foundin changed to: "None"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "msofer"
  9. subsystem changed to: "45. Parsing and Eval"
  10. title changed to: "bug in expr error handler"
  11. type changed to: "Bug"