Artifacts Associated With Ticket 536955ffffffffff
Ticket change [96c6a3f335] (rid 106383) by dgp on 2002-03-29 23:50:10:
- assignee initialized to: "msofer"
- cmimetype initialized to: "text/plain"
- comment initialized to:
% info patch 8.3.4 % proc mybreak {} {return -code break} % catch mybreak 3 % proc breaktest {} {mybreak} % list [catch breaktest msg] $msg 1 {invoked "break" outside of a loop} % proc lucky {} {return -code 7} % catch lucky 7 % proc luckytest {} {lucky} % list [catch luckytest msg] $msg 7 {} It would be more consistent if the only way to pass back a non-TCL_OK, non-TCL_ERROR return code from a proc was by using the [return -code] command itself. I'd rather see: % list [catch luckytest msg] $msg 1 {command returned bad code: 7} - foundin initialized to: "obsolete: 8.4a5"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "dgp"
- subsystem initialized to: "22. [proc] and [uplevel]"
- title initialized to: "inconsistent return code handling"
- type initialized to: "Bug"
Ticket change [414153d64a] (rid 116155) by dgp on 2002-03-30 06:52:53:
- icomment:
Logged In: YES user_id=80530 A related problem: % proc test {} { # Imagine hundreds of lines here break # And hundreds more } % test invoked "break" outside of a loop % set errorInfo invoked "break" outside of a loop while executing "test" Would be much better if ProcessProcResultCode not only converted TCL_BREAK -> TCL_ERROR, but also added good context to the ErrorInfo. - login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [467d2b0ee9] (rid 99529) by dgp on 2002-03-30 07:13:02:
- icomment:
File Added - 20299: proc.patch Logged In: YES user_id=80530 Here's a patch that does both things.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [2906bbf910] (rid 88804) by dgp on 2002-03-30 07:15:46:
- icomment:
File Deleted - 20299: File Added - 20300: proc.patch Logged In: YES user_id=80530 D'oh! Let's try that patch again...
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [dad65c517f] (rid 107859) by dgp on 2002-03-30 07:26:31:
- icomment:
File Added - 20301: proc.patch2 Logged In: YES user_id=80530 updated patch contains changes to test suite too
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [e720bd526b] (rid 104401) by msofer on 2002-03-30 09:19:53:
- icomment:
Logged In: YES user_id=148712 I'm not sure about this one: it could break a lot of user code, and destroy functionality that I think is valuable. In particular, custom exception handling code may depend on the return code being passed up the stack, without requiring every intervening command to catch/rethrow the exception code. This would force such code to either catch/rethrow at each stage, or else to do receive a TCL_ERROR and pass the exception type in a different manner - quite an expensive proposition (see the latest catch.bench in tclbench).
- login: "msofer"
- mimetype: "text/plain"
- username: "msofer"
- icomment:
Ticket change [d12736a936] (rid 113302) by dgp on 2002-03-31 00:31:39:
- icomment:
Logged In: YES user_id=80530 After sleeping on it, I agree that the inconsistency argument doesn't make sense. Yes, [return -code 7] is inconsistent with [return -code break], but it is consistent with [return -code error]. One had to be chosen, and the choice is already made and should not be changed now. I think I've heard of some people defining an "exit" return code to give them a way to exit their program. That usage needs the "exception-like" behavior of extended return codes. What do you think about the improved stack trace for [break] and [continue] errors though?
- login: "dgp"
- mimetype: "text/plain"
- title changed to: "improve [break] error strack trace"
- username: "dgp"
- icomment:
Ticket change [0d9378e0a1] (rid 114389) by dgp on 2002-04-06 04:52:25:
- icomment:
File Deleted - 20301: File Added - 20639: proc.patch3 Logged In: YES user_id=80530 Here's an updated patch that only improves the stack trace for [break] and [continue].
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Add attachment "proc.patch3" [3e39f650f1] (rid 121225) by dgp on 2002-04-06 04:52:25.
Ticket change [4c5afad4e3] (rid 126878) by msofer on 2002-04-16 00:45:54:
- closedate changed to: "2002-04-15T17:45:54"
- closer changed to: "msofer"
- icomment:
Logged In: YES user_id=148712 Committed the improved stack trace patch.
- login: "msofer"
- mimetype: "text/plain"
- resolution changed to: "Accepted"
- status changed to: "Closed"
- username: "msofer"