From: SourceForge.net <no...@so...> - 2006-02-09 19:39:33
|
Feature Requests item #1428575, was opened at 2006-02-09 14:39 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=360894&aid=1428575&group_id=10894 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: 25. Channel System Group: None Status: Open Resolution: None Priority: 5 Submitted By: Don Porter (dgp) Assigned to: Andreas Kupries (andreas_kupries) Summary: Revise Tcl_(Set|Get)ChannelError(Interp) interface Initial Comment: TIP 219 confronted the difficult problem that the Tcl_Channel extension interface doesn't permit easy reporting of error information in the usual Tcl manner (code + msg + return options dictionary), but has a history of returning only a POSIX-style error code, a choice laid down long ago, apparently inspired by unix examples. The TIP 219 solution was to provide a pair of "bypass" areas where error information could be stored and retrieved. One area is attached to the Tcl_Interp; the other within the ChannelState struct. Each area has Get and Set accessors defined. In either case, the "error information" is passed into the "Set" accessor is a single Tcl_Obj value. The value is documented to be a list made up of option value pairs followed by a string message. This format can be recognized as the return options dictionary converted to a list with the interp result lappended. No public Tcl routine returns error information in this format. This forces the caller of Tcl_SetChannelError(Interp) to do this marshalling for themselves. The one known caller of these routines, Tcl's own reflected channel support, indeed is forced to define two routines MarshallError() and UnmarshallError() to tend to this data formatting task. Seems to me all this complexity can be avoided by just having the Set/Get accessors accept two arguments, one for the interp result, and one for the return options dictionary. (I'm assuming the result code is not required, since these interfaces are intended only for the situation when the code is TCL_ERROR) So the request is to revise these interfaces to take two Tcl_Obj arguments instead of one. In addition, the "safety precaution" described in TIP 219, and implemented as FixLevelCode() is, I believe, completely unnecessary. The -level and -code entries of the return options dictionary only have effect for a result code of TCL_RETURN. Since these interfaces are intended only for result codes of TCL_ERROR, there's no need to worry about them, assuming both sides of handling the bypass areas enforce the TCL_ERROR-only interpretation. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=360894&aid=1428575&group_id=10894 |