Version 2 of case

Updated 2005-12-03 22:07:00 by jkock

This Tcl command is obsolete and is supported only for backward compatibility. At some point in the future it may be removed entirely. You should use the switch command instead.


Fair enough, but you can't erase this command from history. In fact the command is valid in current Tcl!

Until recently there was a link to http://purl.org/tcl/home/man/tcl8.4/TclCmd/case.htm but that link is dead now. It would be fine if someone could restore this piece of documentation.

Suppose you have some old code using this command, and as a good Tcl citizen you want to follow the advice above. But how are you supposed to rewrite the line and use switch instead if there is no specification to be found of the old command?

Note that it is not as simple as substituting "case" by "'switch"...