I want to make the string output of a MathObject "painfully unambiguous". Goal is to have formulas like "-x^2" produce "-(x^2)" instead. This seems it can be done by setting showExtraParens => 2 in the context. I've tried two approaches:
$MO->context->flags->(showExtraParens => 2); $MO->string;
And I've tried:
$MO->context->flags->(showExtraParens => 2); $newMO = Value->Package('Formula')->new($MO->context, $MO->string); $newMO->string;
In both cases I was hoping for more parenthesis in the string output, but for simple functions like "-x^2", but I have noticed no difference.