(thanks to Barton for the example)
factor(x^3-1,x-1) =>
factor: second argument must be a nonlinear, univariate polynomial
factor(a^2*g+a*g-a^2 , g^3-1) => division by zero
factor(a^2*g+a*g-a^2 , second(factor(g^3-1)))
=> (a*(-g+3*a+1)*(g-1))/3
factor should not only check that the second argument is nonlinear and univariate, but that it is irreducible
Tested in 5.48.1 SBCL 2.5.7