Learn how to install Tcl locally to solve Exercism's exercises on your own machine
The only tool you need is the TCL interpreter, tclsh
.
For Windows, the best place to get Tcl is the Tcl installer from Magicsplat.
For MacOS and Unix-like operating systems, tclsh
will be already installed.
Typically the installed version will be 8.6.something.
To install the current stable 9.0 version:
For solving exercises using the Exercism web interface, the test runner (as of Feb 2023) uses Tcl version 8.7a4.
It's common to launch an interactive tclsh
session to test out commands while you're coding.
However, tclsh provides only a very basic REPL interpreter with no command line editing or command history.
For an enhanced experience, a program called rlwrap
exists that adds readline functionality:
rlwrap tclsh
To install rlwrap:
It's so handy you'll want to always use it: add this to your ~/.bashrc
command -v rlwrap && alias tclsh='rlwrap tclsh'
The current stable version is 9.0. As indicated above, version 8.6 is still widely deployed.
You can test which version of tclsh
you have installed by running the following command:
echo 'puts [info patchlevel]' | tclsh