Skip to content
Tcl Source Code History Of Ticket 219150
Login

History Of Ticket 219150

Artifacts Associated With Ticket 219150

  1. Ticket change [6c4144718a] (rid 128469) by nobody on 2000-10-26 05:02:20:

    1. assignee initialized to: "nobody"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      OriginalBugID: 1149 Bug
      Version: 8.1b1
      SubmitDate: '1999-02-02'
      LastModified: '2000-05-19'
      Severity: MED
      Status: Assigned
      Submitter: pat
      ChangedBy: hobbs
      RelatedBugIDs: 2248
      OS: Linux
      Machine: Other
      FixedDate: '1999-04-09'
      ClosedDate: '2000-10-25'
      
      
      Name:
      Steve McAndrewSmith
      
      ReproducibleScript:
      # These work fine
      catch { expr 1+1 }  ;# no error
      catch { someundefinedproc } ;# error, but caught
      
      # These don't! (the error is never caught)
      catch { expr 1+- }
      catch { expr int(abc) }
      
      
      
      ObservedBehavior:
      When "expr" generates a syntax error, it is not caught by the "catch" command.
      
      
      
      DesiredBehavior:
      Duh. :-)  Catch should behave the same for "expr" as for any other error.
      
      
      
      
      03/24/1999 14:23 - stanton - This is the expected (if non-obvious) behavior.  The syntax error is detected during compilation of the catch command, so it cannot be masked.  This is a change from 8.0 and should be documented more clearly.
      ---
      04/09/1999 14:43 - surles - Added necessary documentation and an example.
      --
      This was originally noted fixed in 8.1b3, but it is actually a bug,
      not a doc problem.  The work-around is to do:
          set cmd {expr 1+-}
          catch $cmd 
      -- 05/19/2000 hobbs
      
      
      
    4. foundin initialized to: "obsolete: 8.1b1"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "nobody"
    9. subsystem initialized to: "10. Objects"
    10. title initialized to: ""catch" doesn't catch "expr" syntax errors"
    11. type initialized to: "Bug"
  2. Ticket change [f5b88e265b] (rid 130164) by dkf on 2000-11-08 18:56:51:

    1. foundin changed to: "obsolete: 8.3.2"
    2. icomment:
      Problem still exists.  :^(
      
      
    3. login: "dkf"
    4. mimetype: "text/plain"
    5. priority changed to: "7 High"
    6. username: "dkf"
  3. Ticket change [09e4dbc57e] (rid 113729) by dgp on 2000-11-09 02:55:44:

    1. assignee changed to: "dgp"
    2. closedate changed to: "2000-11-08T19:55:44"
    3. closer changed to: "dgp"
    4. icomment:
      According to the release notes accompanying Tcl 8.0,
      this is not a bug, but a known incompatibility with
      Tcl 7 introduced by the bytecode compiler.  Point 2
      on page
      
      http://dev.scriptics.com/doc/compiler.html
      
      reads:
      ...
      2.Catch no longer catches compilation errors 
      
          One consequence of the fact that in Tcl 8.0 compilation errors in scripts are returned immediately is that
          catch no longer prevents compilation errors from aborting command interpretation. For example, 
      
          catch {set} 
      
          immediately reports the error 
      
          wrong # args: should be "set varName ?newValue?" 
      
          To have catch handle compile time errors, give it a script that is only determined at runtime: for example, 
      
          catch [concat {set}] 
      ...
      
      Perhaps this incompatibility wasn't a good idea, but it's
      known and documented, so it's not a bug.  I'm marking this
      Invalid and Closing it.  If you want this changed, file a TIP.
      
      
    5. login: "dgp"
    6. mimetype: "text/plain"
    7. resolution changed to: "Invalid"
    8. status changed to: "Closed"
    9. username: "dgp"