# 1. A backslash as the last character in a line is converted into a space, and all the white space at the beginning of the next line is replaced by this substitution.

2. The difference between double quotes and curly braces is that quotes allow substitutions to occur in the group, while curly braces prevent substitutions.
3. Tcl uses the proc command to define procedures.
4. The expr command is used to parse and evaluate math expressions. You can make expr operate more efficiently by grouping the entire expression in curly braces.
5. TCL assumes that variable names contain only letters, digits, and the underscore. The construct $foo.o represents a concatenation of the value of foo and the literal ".o". 6. If the variable reference is not delimited by punctuation or white space, then you can use curly braces to explicitly delimit the variable name (e.g.,${x}).
7. You can delete a variable with the unset command:
unset ?-nocomplain? ?--? varName varName2 ...
8. The existence of a variable can be tested with the info exists command.
9. You should always group expressions in curly braces and let expr do command and variable substitutions.
10. In TCL, the # must occur at the beginning of a command.
11. A surprising property of Tcl comments is that curly braces inside comments are still counted for the purposes of finding matching brackets.
12. Command arguments are separated by white space, unless arguments are grouped with curly braces or double quotes as described below. If you forget the space, you will get syntax errors about unexpected characters after the closing brace or quote.
13. The Tcl shells pass the command-line arguments to the script as the value of the argv variable. The number of command-line arguments is given by the argc variable. The name of the program, or script, is not part of argv nor is it counted by argc. Instead, it is put into the argv0 variable. argv is a list, so you can use the lindex command to extract items from it:

set arg1 [lindex $argv 0] 14. Some command-line options are interpreted by wish, and they do not appear in the argv variable. The general form of the wish command line is: wish ?options? ?script? ?arg1 arg2? If no script is specified, then wish just enters an interactive command loop. 15. You can use the info script command to find out where the CGI script is, and from that load the supporting file. The file dirname and file join commands manipulate file names in a platform-independent way. set dir [file dirname [info script]] set datafile [file join$dir guestbook.data]

16. You can ask string for valid operations by giving it a bad one:

string junk=> bad option "junk": should be bytelength, compare, equal, first, index, is, last, length, map, match, range, repeat, replace, tolower, totitle, toupper, trim, trimleft, trimright, wordend, or wordstart
17. The string map command translates a string based on a character map. The map is in the form of a input, output list. Wherever a string contains an input sequence, that is replaced with the corresponding output. For example:
string map {f p d l} food=> pool

The inputs and outputs can be more than one character and they do not have to be the same length:

string map {f p d ll oo u} food=> pull
18. A position specifier is i$, which means take the value from argument i as opposed to the normally corresponding argument. The position counts from 1. If a position is specified for one format keyword, the position must be used for all of them. If you group the format specification with double quotes, you need to quote the$ with a backslash:
    set lang 2    format "%${lang}/$s" one un uno    => un
19. The binary command provides conversions between strings and packed binary data representations. The binary format command takes values and packs them according to a template. The resulting binary value is returned:

binary format template value ?value ...?

The binary scan command extracts values from a binary string according to a similar template. It assigns values to a set of Tcl variables:

    binary scan value template variable ?variable ...?
20. Tcl commands described are: list, lindex, llength, lrange, lappend, linsert, lreplace, lsearch, lset, lsort, concat, join, and split.
21. Tcl commands related to list are: list, lindex, llength, lrange, lappend, linsert, lreplace, lsearch, lset, lsort, concat, join, and split.
22. Procedure
22.1 Default parameter values

    proc P2 {a {b 7} {c -2} } {
expr $a /$b + \$c
}
P2 6 3
=> 0

22.2 A procedure can take a variable number of arguments by
specifying the args keyword as the last parameter. When the procedure
is called, the args parameter is a list that contains all the remaining
values.
23. The rename command changes the name of a command:
        rename foo foo.orig
The other thing you can do with rename is completely remove a command by renaming it to the empty string:
        rename exec {}
24. Use the upvar command when you need to pass the name of a variable, as
opposed to its value, into a procedure.
25. Call by Name Using upvar
Use the upvar command when you need to pass the name of a variable, as opposed to its value, into a procedure. The upvar command associates a local variable with a variable in a scope up the Tcl call stack. The syntax of the upvar command is:

    upvar ?level? varName localvar


The level argument is optional, and it defaults to 1, which means one level up the Tcl call stack. You can specify some other number of frames to go up, or you can specify an absolute frame number with a #number syntax. Level #0 is the global scope.

26. You can use any string as an index for array, but avoid using a string that contains spaces.

27. The array get and array set operations are used to convert between an array and a list. The list returned by array get has an even number of elements. The first element is an index, and the next is the corresponding array value. The list elements continue to alternate between index and value. The list argument to array set must have the same structure.

28.