Procedures have the format
For instance, the Fibonacci function looks as follows:proc name args body
proc fib n { if {$n == 0} { return 1 } elseif {$n == 1} { return 1 } else { return [expr [fib [expr $n - 1]] + [fib [expr $n - 2]]] } }
If the procedure has more than one argument, the arguments must be enclosed in braces or quotes to form a list. If there are no arguments, an empty string is specified:
Note also that there must be a space between the argument list and the body opening brace.proc succeed {} { return 1 }