Tcl Source Code

View Ticket
Login
Ticket UUID: 1041949
Title: Standardize, for errors, how Tcl sets the interp's result.
Type: Patch Version: None
Submitter: stwo Created on: 2004-10-07 03:10:53
Subsystem: 45. Parsing and Eval Assigned To: dgp
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2007-11-18 05:07:23
Resolution: Out of Date Closed By: dgp
    Closed on: 2004-10-07 15:38:58
Description:
There are are variety of methods used to set the interp's result in Tcl.  The goal with this is to create a set of functions which set the interp's result in the most 'proper' way and then use them throughout Tcl.  The initial patches provided contain two functions and two shortcut macros, and patches for generic/tclVar.c and unix/tclUnixChan.c (Tcl 8.4.7).  If this is found to be worth pursuing I would be happy to continue the work.
User Comments: [email protected] added on 2007-11-18 05:07:23:
Logged In: NO 

Two suggestions: the name "Tcl_SetResultReturnError" says "how", not "what" -- I'd suggest renaming this to Tcl_ReportError().  Lightning bolt vs. lightning bug and all that.

It may be worth considering adding an optional second parameter, that would be used to set $::errorCode if non-NULL.  That would encourage more callers to actually set this.

int Tcl_ReportError(Tcl_Interp *interp, const char *errorCode, ...);

dkf added on 2007-11-18 04:57:38:
Logged In: YES 
user_id=79902
Originator: NO

Patch re-review: Agree with dgp. The principles of this patch would help a lot, but the implementation won't work as it stands.

dgp added on 2004-10-07 22:38:58:
Logged In: YES 
user_id=80530


The concepts underlying this patch
are good.  Many of the problems
it attacks have very recently been
addressed on the HEAD of Tcl
development in a similar, but
incompatible way.

Please review the HEAD of
Tcl development to see how
things are changing, and join
us in that effort.

stwo added on 2004-10-07 10:10:54:

File Added - 104125: tcl_newres.tar.gz

Attachments: