Version 4 of &&

Updated 2014-01-25 17:28:00 by PeterLewerin

expr logical "and" operator, dual of ||. Returns truth if both arguments are boolean true, and falsity otherwise. Note that this operator short-circuits, and does not evaluate its second argument if the first is false. See & for bitwise "and".

expr { [a b c] && [d e f] }

Note that this operator does not have a command equivalent in tcl::mathop; use the if command instead.

PL: While there is no tcl::mathop equivalent, tcl::mathop::* will give the desired result provided all arguments have been reduced to the "most basic" boolean values (1 or 0), like for instance when evaluated with any kind of boolean operator. For example, the following code

::tcl::mathop::* {*}[lmap elem $listOfNumbers { expr {$elem > 10} }]

will tell you if all elements in $listOfNumbers are greater than 10.