The precise rule affecting element by element mixed calculations with
vectors and arrays is somewhat quirky and hard to find in the references.
From experience I have found the following to be a reliable guide.
- The expression is scanned from left to right.
- Any short vector operands are extended by recycling their values
until they match the size of any previous (or subsequent) operands.
- As long as short vectors and arrays, only, are encountered, the
arrays must all have the same dim attribute or an error results.
- Any vector operand longer than some previous array immediately
converts the calculation to one in which all operands are coerced to
vectors. A diagnostic message is issued if the size of the long vector is
not a multiple of the (common) size of all previous arrays.
- If array structures are present and no error or coercion to vector
has been precipitated, the result is an array structure with the common
dim attribute of its array operands.
Jeff Banfield
2/13/1998