Very nice! We actually thought about having something like that, but there are only that many good names for functions/macros and then it becomes a bit challenging to remember which function does which. Also we had some reservation about this, because it (silently) rebinds the variables a, b, c, x, y
(without explicit assignment).
I agree that nesting the polynomial ring constructor is at the moment a bit awkward, because one always has to do the [1]
business. One the other hand people would complain if we would not return the indeterminant.
FWIW, we have the following macro:
julia> Qx, x, y = @PolynomialRing(QQ, x[1:10], y[1:10])
(Multivariate Polynomial Ring in 20 variables x[1], x[2], x[3], x[4], ..., y[10] over Rational Field, fmpq_mpoly[x[1], x[2], x[3], x[4], x[5], x[6], x[7], x[8], x[9], x[10]], fmpq_mpoly[y[1], y[2], y[3], y[4], y[5], y[6], y[7], y[8], y[9], y[10]])
julia> Qx, x = @PolynomialRing(QQ, x[1:2, 1:2])
(Multivariate Polynomial Ring in x[1,1], x[2,1], x[1,2], x[2,2] over Rational Field, fmpq_mpoly[x[1,1] x[1,2]; x[2,1] x[2,2]])
It is quite handy if one has an example with multidimensional indices for the variables.