With execute the polynomial will just be displayed but you can't work with it.
Even an assignment afterwards like
poly g = _; is not possible.
To have access, you must enclose the string (variable)
nameofpoly into
the backticks ` ` . These are the delimiter for name substitution
See
Special characters:
http://www.singular.uni-kl.de/Manual/la ... .htm#SEC63Modified solution:
Code:
> ring R = 0, (x,y,z), dp;
> poly f = x+y+z;
> string s = "f";
> `s`;
x+y+z
> proc p1mod(def R, string nameofpoly)
{
setring(R);
poly g = `nameofpoly`;
g = g+1;
g;
}
> ring S = 0, x, dp;
> p1mod(R, "f");
x+y+z+1