diff options
author | Steve Bennett <steveb@workware.net.au> | 2009-07-28 15:52:03 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2010-10-15 10:11:02 +1000 |
commit | 1692f3e4c3f8460446e8a21bc7c06b150c3c6aaa (patch) | |
tree | a51f930c56aa15a4c698ca2c685209355544f3e5 | |
parent | 108b579758bd71bb4a04f3cf8391e6b2d0da5337 (diff) | |
download | jimtcl-1692f3e4c3f8460446e8a21bc7c06b150c3c6aaa.zip jimtcl-1692f3e4c3f8460446e8a21bc7c06b150c3c6aaa.tar.gz jimtcl-1692f3e4c3f8460446e8a21bc7c06b150c3c6aaa.tar.bz2 |
tcl6 no longer needs stdio or autoload
aio now does Tcl6 stdio automatically
glob and array are autoloaded as static extensions if available
-rw-r--r-- | stdio.tcl | 74 | ||||
-rw-r--r-- | tcl6.tcl | 13 |
2 files changed, 0 insertions, 87 deletions
diff --git a/stdio.tcl b/stdio.tcl deleted file mode 100644 index 1a6cc47..0000000 --- a/stdio.tcl +++ /dev/null @@ -1,74 +0,0 @@ -# (c) 2008 Steve Bennett <steveb@workware.net.au> -# -# Implements Tcl-compatible IO commands based on the aio package -# -# Provides puts, gets, open, close, eof, flush, seek, tell - -package provide stdio 1.0 -catch {package require aio 1.0} - -# Remove the builtin puts -rename puts "" - -set stdio::stdin [aio.open standard input] -set stdio::stdout [aio.open standard output] -set stdio::stderr [aio.open standard error] -set stdio::std_channel_map [list stdin ${stdio::stdin} stdout ${stdio::stdout} stderr ${stdio::stderr}] - -proc stdio::std_channel {channel} { - return [string map ${::stdio::std_channel_map} $channel] -} - -proc puts {channel args} { - set nonewline 0 - if {$channel eq "-nonewline"} { - set nonewline 1 - set channel [lindex $args 0] - set args [lrange $args 1 end] - } - if {[llength $args] == 0} { - set args [list $channel] - set channel stdout - } - - set channel [stdio::std_channel $channel] - - if {$nonewline} { - $channel puts -nonewline {expand}$args - } else { - $channel puts {expand}$args - } -} - -proc gets {channel args} { - set channel [stdio::std_channel $channel] - return [uplevel 1 [list $channel gets {expand}$args]] -} - -proc open {file args} { - return [aio.open $file {expand}$args] -} - -proc close {channel} { - [stdio::std_channel $channel] close -} - -proc eof {channel} { - [stdio::std_channel $channel] eof -} - -proc flush {channel} { - [stdio::std_channel $channel] flush -} - -proc read {channel args} { - [stdio::std_channel $channel] read {expand}$args -} - -proc seek {channel args} { - [stdio::std_channel $channel] seek {expand}$args -} - -proc tell {channel} { - [stdio::std_channel $channel] tell -} @@ -5,19 +5,6 @@ package provide tcl6 1.0 -package require stdio - -# Extremely simple autoload approach -set autoload {glob glob array array} - -proc unknown {cmd args} { - if {[info exists ::autoload($cmd)]} { - package require $::autoload($cmd) - return [uplevel 1 $cmd $args] - } - error "invalid command name \"$cmd\"" -} - # Set up the ::env array set env [env] |