
TIP #208: Add a 'chan' Command
TIP #208: ADD A 'CHAN' COMMAND
================================
Version: $Revision: 1.1 $
Author: Jeff Hobbs <jeffh_at_activestate.com>
State: Draft
Type: Project
Tcl-Version: 8.5
Vote: Pending
Created: Friday, 02 July 2004
URL: http://www.*-*-*.com/
WebEdit: http://www.*-*-*.com/
Post-History:
-------------------------------------------------------------------------
ABSTRACT
==========
This TIP proposes adding a *chan* command that would serve as a
top-level command container for all the related channel commands that
have proliferated over time, as well as future new channel-based
commands.
RATIONALE
===========
Tcl's channel system has evolved over time from a thin layer on top of
the OS into a very complex, multi-platform system. There are numerous
top-level commands for channels already, with more being proposed for
Tcl 8.5. This command would centralize them, making it easier for new
users to see all the related channel commands, much as *string* or
*file* operate today.
The name *chan* was chosen over /channel/ because it is a clearly
recognizable abbreviation, much like /eval/ vs. /evaluate/ and /interp/
vs /interpreter/.
SPECIFICATION
===============
A new command *chan* will be added with the following syntax:
chan blocked ; # fblocked
chan close ; # close
chan configure ; # fconfigure
chan copy ; # fcopy
chan eof ; # eof
chan event ; # fileevent
chan flush ; # flush
chan gets ; # gets
chan puts ; # puts
chan read ; # read
chan seek ; # seek
chan tell ; # tell
Each represents the existing command that is commented. The arguments
to each would remain what the current command takes.
Note that *open* is not included above, as it is a channel creation
function, just like *socket*.
FUTURE POSSIBILITIES FOR EXTENDING THE 'CHAN' COMMAND
-------------------------------------------------------
I would also recommend that [TIP #206] be integrated as *chan
truncate*. Further TIPs may also recommend subcommands such as *chan
transform*, *chan stack* and *chan unstack* (exposing the channel
stacking subsystem available in the C API), among other possibilities.
DEPRECATION OF EXISTING COMMANDS
----------------------------------
In addition, I would recommend only the following commands be marked
deprecated so as to help systematize their names better:
fblocked
fconfigure
fcopy
fileevent
REFERENCE IMPLEMENTATION
==========================
The implementation of this TIP is really a simple command that makes
use of the existing command implementations. It could be a namespace
ensemble or a C-based command.
COPYRIGHT
===========
This document has been placed in the public domain.
-------------------------------------------------------------------------
TIP AutoGenerator - written by Donal K. Fellows
Announcements archived at http://www.*-*-*.com/
Tcl/Tk at http://www.*-*-*.com/ ]]