Overview
| Artifact ID: | 0fb027f3b69a35502143be6edf041197a0f2b036 |
|---|---|
| Ticket: | 402725ffffffffffffffffffffffffffffffffff
Document Tcl's standard channels |
| User & Date: | dgp on 2001-08-25 07:03:38 |
Changes
- icomment:
Logged In: YES user_id=80530 That covers the bases pretty well. I had missed the detail that Tcl_CreateChannel() only fills NULL standard channels that have previously been initialized. A few places you say this initialization must be done by a call to Tcl_GetStdChannel(), but Tcl_SetStdChannel() also performs the initialization. Another problem is that these changes suggest that standard channel initialization with a Tcl_{Get|Set}StdChannel() call can only be done by the application. The example is Tcl_Main's initialization in tclsh. But that is not true. Every call to Tcl_RegisterChannel() in a non-safe interp will call Tcl_GetStdChannel for all three standard channels, so it you have any channel at all registered in an interp, you will have the standard channels. Also every use of the one of the names std* where a channel name is expected will cause a call to Tcl_GetStdChannel for that channel, initializing it if needed. There are other places too. The application can't prevent it. That's why the std* channels are a feature of the Tcl library, not only the application tclsh. Given that Tcl will initialize the std channels as needed (in possibly surprising ways via Tcl_CreateChannel), we need to advise application writers that they need to initialize them themselves, or risk Tcl making a bad choice for them. A related matter in Tk is where to document the mess that is standard channels for wish on Windows. - login: "dgp"
- mimetype: "text/plain"
- username: "dgp"