Evaluate in ring operator (was called :: in CoCoA-4)
CoCoA-4 has the
:: operator which evaluated expressions in a given ring:
It would be nice to have something similar in CoCoA-5; this would make it easier to specify poly ring homomorphisms, perhaps like this
P1 ::= QQ[x,y]; P2 ::= QQ[a,b]; PolyAlgHom(P1, P2, P2::[a^2,b^3]);
Currently you must
Use P2to create the vector of indet images, and then pass that to
PolyAlgHom. This is relevant only at top level, I think.
PolyAlgHom(P1, P2, [ReadExpr(P2,"a^2"), ReadExpr(P2,"b^3")])
#2 Updated by John Abbott over 2 years ago
- Target version changed from CoCoA-5.1.3/4 Jan 2016 to CoCoA-5.?.?
It might not be too painful if
ReadExpr could read lists as well. The example in the issue description could then become:
PolyAlgHom(P1, P2, ReadExpr(P2,"[a^2,b^3]"));
Maybe there could be a fn called
ReadExprList if we do not like extending
ReadExpr to return different types of result.
I admit that it does "feel funny/awkward" having to put the value inside a string which is parsed only at run-time... it could be nice to have read-time parsing (but that would presumably need a new syntax).
Anyway, delaying this issue to some future version of CoCoA-5.
#4 Updated by John Abbott over 1 year ago
The suggestion of another function (perhaps called
ReadExprList) still seems good to me.
Hmmm, but then again a list of lists would still be problematic :-/
In C++ the fn needs to have a well-defined return type, so we really do need different fns names for different return types (assuming the args continue to be a ring and a string).