Expressions
- Almost identical to C/C++
- Evaluated through the expr command
- In the
ifandwhileclause the expr is implicitExample:% set x .123 % expr 2*sin($x) - Some operators (<, >, <=, >=, ==, != ) can be used with
stringin theifstatementExample:% set s "hello" % if { "hello" == $s } { do_something } - If both the operands of a $==$ are numerical Tcl uses numeric comparison (see string operation for the string compare command).