Overview
| Artifact ID: | 71e12be4f60949219ce6b4545810475dc928b7af |
|---|---|
| Ticket: | 1428575fffffffffffffffffffffffffffffffff
Revise Tcl_(Set|Get)ChannelError(Interp) interface |
| User & Date: | dgp on 2006-02-09 19:39:30 |
Changes
- assignee changed to: "andreas_kupries"
- cmimetype changed to: "text/plain"
- comment changed to:
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.
- foundin changed to: "None"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "dgp"
- subsystem changed to: "25. Channel System"
- title changed to: "Revise Tcl_(Set|Get)ChannelError(Interp) interface"
- type changed to: "RFE"