errors in doc/StdChannels.3
Closed / Invalid497437ffffffffffffffffffffffffffffffffffCreated 25 years agoUpdated 25 years ago
Descriptionplain2001-12-28 22:17:38
From StdChannels.3:
...
INITIALIZATION OF TCL STANDARD CHANNELS
...
2) All uninitialized standard channels are
initialized to platform-specific default values:
...
(b) when information about any standard channel is
requested with a call to Tcl_GetStdChannel, ...
That is not true. When Tcl_GetStdChannel(TCL_STDIN)
is called, for example, only the standard channel
"stdin" is initialized to the default, *not* "[a]ll
uninitialized standard channels". That is, the
standard channels are initialized one by one, not as
a block. That's why Tcl_GetStdChannel() maintains a
separate std*Initialized flag for each of them.
More from StdChannels.3:
...
tclsh
The Tcl shell (or rather Tcl_Main) uses method 2 to
initialize the standard channels.
Not (exactly) so. Tcl_Main calls Tcl_GetStdChannel
only on certain channels and only under certain
conditions. Most notably, when tclsh evaluates a
startup script, no call to Tcl_GetStdChannel() is made.
In that common case, it is more likely method 3 that
actually causes Tcl's standard channels to be set to
their platform defaults.
For the second error, it may be better to make the code
agree with the docs, instead of changing the docs to
match the code. I'll wait for Andreas' comment when
he gets back. We'll need to discuss where in Tcl_Main
it would be best to perform standard channel
initialization.
andreas_kupriesplain2002-01-08 04:58:13
Logged In: YES user_id=75003 From the chat gpaku: when you have time, we should discuss Tcl Bug 497437. dgpabout some errors in the "standard channels" documentation., akuOk, time is now available. dgpgot the report? akuI believe the item is invalid. Reason. You call Tcl_GetStdChannel (STDIN). This initializes stdin. The function calls Tcl_RegisterChannel to register it at the interp. Tcl_RegisterChannel calls GetChannelTable to create/retrieve the structure to register the channel in. This function initializes all three standard channels akuAs for the second part I agree with you that it is not only easier to make the code consistent with the docs, but also easier to understand for a user of the library. * dgp goes source diving... akutcl 8.3.4, tclIO.c: Lines 344, 713, 506f akutcl8.4cvs head, tclIO.c, lines 362, 763, 525f dgpD'oh! dgpCancel the whole report. It's fine.
Log in (anonymous is fine) to add a comment.