Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2007-11-18
05:07 • Ticket [1041949fff] Standardize, for errors, how Tcl sets the interp's resul... artifact: fa9fedb958 user: nobody
04:57 • Ticket [1041949fff]: 4 changes artifact: 4618897a11 user: dkf
2004-10-07
22:38 • Closed ticket [1041949fff]. artifact: e2f0353da2 user: dgp
10:10 • Add attachment tcl_newres.tar.gz to ticket [1041949fffffffff|1041949fff... artifact: 5f13ab3063 user: stwo
10:10 • Ticket [1041949fff] Standardize, for errors, how Tcl sets the interp's resul... artifact: 2e6d99522a user: stwo
03:10 • New ticket [1041949fff]. artifact: 930355dd5c user: stwo

Standardize, for errors, how Tcl sets the interp's result.

Closed / Out of Date1041949fffffffffffffffffffffffffffffffffCreated 22 years agoUpdated 19 years ago
Descriptionplain2004-10-07 03:10:53
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.
stwoplain2004-10-07 10:10:54
File Added - 104125: tcl_newres.tar.gz
dgpplain2004-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.
dkfplain2007-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.
[email protected]plain2007-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, ...);
Log in (anonymous is fine) to add a comment.

Attachments: