tcl

Tcl Sources

Tcl/Tk Programs

tclshar
An extremely rudimentary version of shar, the unix shell archive maker, which works with tclsh. A tclshar is a tcl program which when executed extracts itself into the current directory and recreates the directories and files it archives. This is the obvious way to distribute pure tcl programs so they can be downloaded onto windows and macs as well as unix systems.

Tcl Expr Patch

The Patch vs. 8.2.0

The Patch vs. 8.4.0


Well, it happened again. Someone asks a perfectly innocent question, and the next thing I know I'm in touch with a deep vein of hostility and several paragraphs into a jeremiad on the evils of Tcl's expr command. It isn't Tcl's problem, really, that I hate writing code that uses expr. It's my problem. So here's my problem and here's my solution.

Expr Before

Random Numbers

Good random numbers are hard to find. It's nice to have a random number generator that continues to be random even when you take the modulus by a small integer to pick cards from a deck or simply test for odd or even to simulate a coin flip. This one is that good.

random.tcl
George Marsaglia's mother of all random number generators, written in Tcl.
random.c.shar
Syndicate content