John LoVerso's Page


What's New

Things I've Released

This is a brief list of some of the things I've done that have been made publically avaialable. Unless otherwise specified in the distribution, this work is covered by this copyright, which gives broad use and distribution rights.

tsoc - a tiny socket connection program

For almost 11 years I've had this small program called soc that was a tiny, raw mode telnet-like client. Very useful for debugging the typical text-based Internet server.

I have one server that insists on requiring the client use a so-called privledge port. I really didn't want to bother to fix up the C code to call rresvport(), so I tossed together this little replacement for soc, including a new option for a privledged port.

It took me 8 minutes to write tsoc plus 2 more to add raw mode after the fact (I took the code from my tcltelnet). It is 84 lines long, verses 178 lines for soc.c. The C code has a rather nasty 44 line function to handle shunting of data between the two sources; tsoc just uses unsupported0 (or my copychan, if it finds it). However, the C code will try to connect any address if the name has more than one; official Tcl is still missing this feature (even though I added it in to the 7.5 beta sources about a year ago).

      Name                    Size     Last modified
[tcl] tsoc                        

comm - a replacement for send

Comm is a replacement for Tk's send command that is written using only Tcl, utilitizing the socket command of Tcl (7.5, 7.6, 8.0 and later).

As such, comm provides cross interpreter communication to not only applications using wish, but also to applications using tclsh or those on machines where send is not supported (Windows, MacOS). I have gone through particular pain to make sure this is semantically identical to send, both for complex transfers and for error cases.

Comm fits well in other applications. Below you will find patches for tkinspect and tkcon to enable them to use comm along side send. Because comm lacks a name-to-port mapper (something you get for free with send), you need to know the id of other apps before you can send them commands. For tkinspect and tkcon, this is done with a connect menu entry. (It is simple to use - just try it).

Comm comes with a man page that describes both the API and usage. Remember that comm can be used standalone in any Tcl application by simply including the comm.tcl source file or by using package require Comm.

Comm exports itself as a package, currently at version 3.7. The major version will only increment when a major, non-compatible API change happens. Minor bug fixes and changes will only affect the minor version. The API changes are documented in the man page.

The remaining work items I have for comm are outlined in the man page, with the exception of a name-to-port mapper (or nameserver). I have one that I've worked on, but it is not complete enough to be useful. It will be a add-on that is not built into comm at all. (It operates much like the Tcl-DP nameserver).

Andreas Kupries has built a nameserver for comm as part of his Pool library.

      Name                    Size     Last modified
[shar] comm.shar.gz                
Here are links to older, obsolete versions of comm. The first public version, 1.0, required obTcl. The next public version, 2.0, was rewritten so that it no longer used obTcl. I made this change because Comm only made cursory use of obTcl, and having the OO as a requirement made it difficult for other apps to utilize it in a lightweight fashion. The other differences in versions is that the internal documentation has been improved (almost all of the size difference is accountable for in lines of comments, most of which are substitute for a man page).
[shar] comm.3.5.shar.gz            
[shar] comm.3.4.shar.gz            
[shar] comm.3.3.shar.gz            
[shar] comm.3.2.shar.gz            
[shar] comm.3.1.shar.gz            
[shar] comm.3.0.shar.gz            
[shar] comm.2.3.shar.gz            
[tcl] comm.2.2.tcl                
[tcl] comm.2.0.tcl                
[tcl] comm.1.0.tcl                

tkinspect & tkcon using comm

I'm currently using comm under Windows to enable the remote debug facilities of tkinspect and tkcon to be used. (Remember, Windows Tcl doesn't support send). These patches allow both programs to use send and/or comm; that is, under UNIX you can use them simultaneously.

The tkcon change is a simple patch that you can apply to the tkcon.tcl you can get at Jeff's tkcon page.

There are two tarballs to update tkinspect 5.1.6 (which you can get at the Tcl Contributed Software archive). The lite archive includes just the changed files (including comm.tcl) and can be overlaid on an existing tkinspect installation. The full archive contains all of a tkinspect installation (suitable to put plopped on a Windows machine).

      Name                    Size     Last modified
[tar] tkcon.70.patch              
[tar] tkinspect-lite.tar.gz       
[tar] tkinspect-full.tar.gz       


My collection of convenience proc-manipulation functions.
      Name                    Size     Last modified
[tcl] width=24 height=24 proc.tcl                    


Releases of Caubweb were once available at The Open Group on a freely distribuable basis. Caubweb was a personal Web proxy server that hotwires a browser's cache, among other things. I gave a brief overview of this work at the 4th USENIX Tcl/Tk Workshop (1996) and a full paper at the 5th Tcl/Tk Workshop (1997). The slides and the paper are available. Caubweb includes a general library of code for WWW clients and servers, implemented using obTcl. It uses the copychan extension, described below. It uses the comm package described below.

Also includes: URL parsing, HTTP cache, HTTP proxy, utility scripts (httpGet), HTTP server, plus reentrant HTML parser based on Steve Uhler's work.

This was part of the Detached Web project at the RI. Since our code was written in Tcl, things ran on UNIX and Windows (95/NT), and almost MacOS.

copychan extension

Updated version of copychan, similar to copyfile of TclX. This is derived from the undocumented unsupported0 command of Tcl7.5. This builds a loadable package for UNIX and Windows called Copychan, which adds a command with this syntax:
copychan ?-copied varName? inChan outChan ?outChan...? ?numBytes?
      Name                    Size     Last modified
[tar] copychan.tar.gz            

Note that the Caubweb distribution includes the source and the extension, pre-compiled on all the supported platforms.


A version of tkprompt that works with Tk4.0 and Tk4.1.
      Name                    Size     Last modified
[shar] tkprompt.shar               


tkNewMail is my replacement for xbiff (with a clock, too). It can report about new mail in several ways, including using POP directly (Tcl7.5 required) or using MH folders. It also knows how to work with exmh.
      Name                    Size     Last modified
[shar] tkNewMail.shar.gz           

Things I've Mangled

This points to various code I've worked on (or am working on) that was not primarily written by me.

Past Work I've Done

This lists some of original my Tcl code. My work is typically entirely in Tcl; that is, no C. If there isn't a hyperlink, it means it is just because I haven't gotten around to it. If you want something, just ask.


Library code


and other (obsolete, Tk3.6) code

Nested Arrays in Tcl

As of Tcl8.0, the upvar'd array is no longer available. While less than satisfactory, I can live with this. However, John Ousterhout is apparently willing to leave in the less than useful array-like name sort of nested array. This later mis-feature is error prone and confusing, as a recent thread in comp.lang.tcl shows.

Here are my collected notes on this subject:

Last modified on .
This page accessed times.