5
$\begingroup$

On a recent answer I ran into a little problem. I wrote $x^3.\{1,1\}$ using Mathematica's 2D input, then copied and pasted the expression here, yielding x^3.{1, 1}. This however is not equivalent:

x^3.{1, 1} // FullForm // HoldForm
Times[Power[x, 3.`], List[1, 1]]

Either x^3 .{1, 1} or (x^3).{1, 1} would have been acceptable.

I should have spotted the problem myself but then again I feel I should not have to.

Can we make Mathematica copy expressions like this correctly? I am encouraged that we can:

$\endgroup$
  • $\begingroup$ FrontEndExecute@ ExportPacket[ BoxData@RowBox[{SuperscriptBox["x", "3"], ".", RowBox[{"{", RowBox[{"1", ",", "1"}], "}"}]}], "InputText" ] one can say it is a bug. $\endgroup$ – Kuba Feb 6 '17 at 18:56
  • 2
    $\begingroup$ Route through expression works fine: ToString[ MakeExpression[ RowBox[{SuperscriptBox["x", "3"], ".", RowBox[{"{", RowBox[{"1", ",", "1"}], "}"}]}], StandardForm ], InputForm ] $\endgroup$ – Kuba Feb 6 '17 at 18:58
  • 1
    $\begingroup$ Probably related: stackoverflow.com/q/5676993 $\endgroup$ – Sjoerd C. de Vries Mar 1 '17 at 12:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.