Tcl

**Tcl** (pronounced "tickle" or _tee cee ell_ ) or **Tool Command Language** is a High-level programming language which can be used for many things. Tcl was made to be easy to use, but able to do many things. Tcl's language is based on commands which tell the computer what to do or how to save a variable. Tcl is able to do object-oriented, imperative, functional, or procedural styles.

Tcl is used a lot to in C to create prototypes quickly. There are interpreters available for many operating systems. This means many different kinds of computers are able to run Tcl code. Tcl is a very small language which means it is good to use as embedded systems.

Tcl is sometimes combined with Tk. When it is, it is called **Tcl/Tk**. Tcl/Tk is a part of the normal Python installation.

## History

Tcl was created by John Ousterhout at University of California, Berkeley. Ousterhout won a ACM Software System Award in 1997 for making Tcl/Tk.

Safe-Tcl is a form of Tcl that has certain parts turned off so it can't hurt the computer which is running it. Nathaniel Borenstein and Marshall Rose created Safe-Tcl. Safe-Tcl can only work on some files including email messages.

## Examples

In Tcl programming, empty whitespace separates words. Commands are ended by going to a new line or a semicolon:

word0 word1 word2 ... wordN

The first word is always a command which comes from Tcl's library:

commandName arg1 arg2 ... argN

For example, the commmand _puts_ makes the computer display something:

In that example, "Hello, World!" is called a string. Tcl adds a special character which can't be seen at the end of a line. This character tells the computer to go a new line after the command is complete.

Tcl is able to do math and many other things using variables. In order to use a variable, the programmer must set their value:

After a variable is set, it can be used in other parts of the program or set to something different. Variables can be used to perform math:

The command _expr_ tells the computer to solve the "expression" or, in this case, an equation.

## Easy commands

- `set` saves numbers, words, or letters, to a variable. It can also be used to change what is in a variable.
- `proc` tells the computer what a new command will do (procedure).
- `if` tells the computer to do what is written only if something is true.
- `while` tells the computer to do what is written as long as something is true.
- `foreach` tells the computer to something for each item in a list of variables.
- `break` stops the command from running. This is good to use to get out of a loop.
- `continue` stops the active command, but allows the loop to continue. If the loop is a `while` loop, it will start over. It will let `foreach` and `for` go to the next step in the program.
- `return` stops the active command and loop, then goes back to the procedure with a value.

## Related pages

- Eggdrop
- TclX
- List of programming languages

## Other websites

- Tcler's Wiki
- Tcl and Tk source downloads
- TkDocs

## Infobox (programming language)

- **name**: Tcl
- **logo**: Tcl-powered.svg
- **paradigm**: multi-paradigm programming language, multi-paradigm: Object-oriented programming, object-oriented, functional programming, functional, procedural programming, procedural, event-driven programming, imperative programming, imperative
- **designer**: John Ousterhout
- **developer**: Tcl Core Team
- **latest release version**: [https://sourceforge.net/projects/tcl/files/Tcl/8.6.8/tcltk-release-notes-8.6.8.txt/view 8.6.8 (Dec, 22 2017)]
- **typing**: dynamic typing, everything can be treated as a string (programming), string
- **implementations**: [https://www.activestate.com/activetcl ActiveTcl] [https://www.androwish.org Androwish]
- **dialects**: [http://jim.tcl.tk Jim]
- **influenced by**: AWK, Lisp (programming language), Lisp
- **influenced**: PHP, Tea (programming language), Tea, Windows PowerShell, PowerShell
- **license**: BSD licenses, BSD-style
- **file ext**: .tcl, .tbc