#1940 catch {expr something} is spotty

obsolete: 8.3.4
closed-fixed
5
2002-07-03
2002-07-03
Anonymous
No

Version: 8.3.4
OS: Windows NT 4.0 SP 6 and Windows 2000

Problem:
When using expr within a catch statement, sometimes an
error is still thrown. For example:

catch {expr NA}
-> Throws an error

catch {expr NA} cerr
-> Returns 1

catch {expr}
-> Throws an error

catch {expr} cerr
-> Returns 1

catch {expr this should work}
-> Returns 1

catch {expr 5/0}
-> Returns 1.

Expected behavior:
Should return 1 on any error condition.

Discussion

  • Donal K. Fellows

    • assigned_to: dkf --> msofer
     
  • miguel sofer

    miguel sofer - 2002-07-03

    Logged In: YES
    user_id=148712

    The [catch] compiler should never return TCL_ERROR, as this
    prevents the error to be caught. It now returns
    TCL_OUT_LINE_COMPILE instead, so that the error occurs at
    runtime and can be caught.

    Fixed in HEAD and tcl-core-8-3-1-branch.

     
  • miguel sofer

    miguel sofer - 2002-07-03
    • labels: 105657 --> 47. Bytecode Compiler
    • status: open --> closed-fixed
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks