Question: Unexpected difference between products and sums wrt evaluation rules of parameterized Matrices

I expect the output for the following code to be a Matrix containing 720 and a Matrix containing 21. What I get is a Matrix containing x^6 and one containing 21, which shows an unexpected difference between the parameter evaluation rule for Matrix products and that for Matrix sums. Is there a good reason for this, or is it a bug? Do any other binary operators between rtables also show this weirdness? 

proc(n::nonnegint) 
local x, q, v:= <<x>>, s:= <<0>>, p:= <<1>>; 
   for x to n do p:= p.v; s:= s+v od; 
   p, s 
end proc(6);

 

Please Wait...