This is a tag page.

Testin: Testing the Tin package manager for Tcl

John Peck
Published

tin_can

Image by upklyak on Freepik

One of the pain points for new Tcl users is the lack of an obvious package repository and management system. Python has pypi and pip. Tcl has Teapot and Teacup, but these were more popular when they were maintained by ActiveState. If you just want to help users (or yourself) install a few Tcl packages hosted on Github, the Tin package manager is worth checking out.

I developed testin as a way to get to know Tin. Once you manually install Tin, installing other packages is as easy as

$ sudo tclsh
% package require tin
% tin add -auto testin https://github.com/johnpeck/testin install.tcl
% tin install testin

...on linux (since the default package directory is owned by root). If you're using Github for development anyway, Tin doesn't make you understand a new package repository.

The Testin repository has detailed instructions for installing Tin, Tcllib, and finally Testin.

A nugget: named arguments for Tcl procs in Testin

Testin has one function: intlist. It simply makes a list of integers, similar to Python's range. But it experiments with named arguments:

% package require testin
1.3
% testin::intlist -length 6
0 1 2 3 4 5

Nifty, right? The intlist function takes two arguments, but cmdline allows omitted arguments to have default values (in this case, the default first integer is 0). And named arguments make procedure calls easier to understand. This idea came from the Tcler's Wiki.

Updates

2024-Jul-04

First post.

Links