Expressions
- Almost identical to C/C++
- Evaluated through the expr command
- In the
if
andwhile
clause the expr is implicitExample:% set x .123 % expr 2*sin($x)
- Some operators (<, >, <=, >=, ==, != ) can be used with
string
in theif
statementExample:% 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).