next up previous contents
Next: Coercion of structures to Up: Vectors and vector operators Previous: Reduction operators   Contents

Vectors as conditions

If a vector appears as the condition in a conditional expression or statement, then the logical ``or'' of the elements of the vector is taken as the condition. Thus, for example,

    [x,y,z] ? foo : bar
is equivalent to
    (x | y | z) ? foo : bar
In particular, this means that when a bit vector is used as a condition, it is considered to be true if and only if it is non-zero.



2002-10-28