next up previous contents
Next: Arithmetic on vectors Up: Vectors and vector operators Previous: Extension of operators to   Contents

Vector coercion operator

When combining vectors of different length with a binary operator, the shorter vector is prepended with a vector of zeros to make the vectors the same length. Thus, for example,

        [a,b,c,d] * [e,f]
is equivalent to

        [a,b,c,d] * [0,0,e,f]

In general, if x and z are booleans, then

        (w :: x) * z = (w * 0) :: (x * z)
        x * (y :: z) = (0 * y) :: (x * z)

The exceptions to the above rule are

These exceptions are described below.



2002-10-28