I am trying to write a quaternion package, I also want it to be able to multiply quaternion polynomials where the unknown "x" remains on the right of the coefficient. the I,J,K rules are standard quaternion rules.

**define(M, 'flat', 'multilinear', 'identity' = 1, **

**M(I,I)=-1, M(J,J)=-1, M(K,K)=-1, M(I,J)=K, M(J,I)=-K, M(J,K)=I, M(K,J)=-I, M(I,K)=-J, M(K,I)=J,**

**M(a::anything,b::anything*x)=M(a,b)*x,**

**M(a::anything*x,b::anything)=M(a,b)*x,...**