Skip to main content
edited title
Link
theorist
  • 3.6k
  • 1
  • 16
  • 29

Looking for example(s) of when MMA fails When is it unsafe to properly interpret copy-and-pasteduse TraditionalForm output in subsequent input?

deleted 2 characters in body
Source Link
theorist
  • 3.6k
  • 1
  • 16
  • 29
  1. Can I get some examples of TraditionalForm outputs that MMA subsequently misinterprets? I don't know of any myself [except see EDIT added below]. More interestingly, are there general classes of expressions that MMA will misinterpret and, if so, why?

  2. If MMA does such a misinterpretation, will it always give an error? And if so, is it always clear that the error is due to the use of TraditionalForm? If the answers to both of these are "yes", then it's not a problem for me to do this since, in the rare cases when I get an error, I can easily correct it. My concern, however, is the possibility that MMA could misinterpret a TraditionalForm expression, yet not give an error.

  3. What causes MMA to give me the first warning (which follows pasting) vs. the second (which follows shift-enter), and why do I never get never both? And with the first warning, does selecting the "Paste Literal" option convert what I'm pasting to StandardForm (that seems to be what it's doing)? And regardless Regardless, if I'm offered, and select, the "Paste Literal" option, is the input always interpreted identically to a StandardForm input?

  4. [Added after EDIT, below]. Suppose I don't copy-and-paste outputs into inputs, and don't use @TraditionalForm in my inputs. If I set MMA to output TraditionalForm globally in Preferences -> Evaluation, is the evaluation of previous outputs always the same as it would be if my output were globally set to StandardForm?

int = Integrate[x^2, x]
 %/x
Head[%%]
int/x
Head[int]
SameQ[int == x^3/3]
int = TraditionalForm@Integrate[x^2, x]
 %/x
Head[%%]
int/x
Head[int]
SameQ[int == x^3/3]
  1. Can I get some examples of TraditionalForm outputs that MMA subsequently misinterprets? I don't know of any myself [except see EDIT added below]. More interestingly, are there general classes of expressions that MMA will misinterpret and, if so, why?

  2. If MMA does such a misinterpretation, will it always give an error? And if so, is it always clear that the error is due to the use of TraditionalForm? If the answers to both of these are "yes", then it's not a problem for me to do this since, in the rare cases when I get an error, I can easily correct it. My concern, however, is the possibility that MMA could misinterpret a TraditionalForm expression, yet not give an error.

  3. What causes MMA to give me the first warning (which follows pasting) vs. the second (which follows shift-enter), and why do I never get never both? And with the first warning, does selecting the "Paste Literal" option convert what I'm pasting to StandardForm (that seems to be what it's doing)? And regardless, if I'm offered, and select, the "Paste Literal" option, is the input always interpreted identically to a StandardForm input?

  4. [Added after EDIT, below]. Suppose I don't copy-and-paste outputs into inputs, and don't use @TraditionalForm in my inputs. If I set MMA to output TraditionalForm globally in Preferences -> Evaluation, is the evaluation of previous outputs always the same as it would be if my output were globally set to StandardForm?

int = Integrate[x^2, x]
 %/x
Head[%%]
int/x
Head[int]
SameQ[int == x^3/3]
int = TraditionalForm@Integrate[x^2, x]
 %/x
Head[%%]
int/x
Head[int]
SameQ[int == x^3/3]
  1. Can I get some examples of TraditionalForm outputs that MMA subsequently misinterprets? I don't know of any myself [except see EDIT added below]. More interestingly, are there general classes of expressions that MMA will misinterpret and, if so, why?

  2. If MMA does such a misinterpretation, will it always give an error? And if so, is it always clear that the error is due to the use of TraditionalForm? If the answers to both of these are "yes", then it's not a problem for me to do this since, in the rare cases when I get an error, I can easily correct it. My concern, however, is the possibility that MMA could misinterpret a TraditionalForm expression, yet not give an error.

  3. What causes MMA to give me the first warning (which follows pasting) vs. the second (which follows shift-enter), and why do I never get both? And with the first warning, does selecting the "Paste Literal" option convert what I'm pasting to StandardForm (that seems to be what it's doing)? Regardless, if I'm offered, and select, the "Paste Literal" option, is the input always interpreted identically to a StandardForm input?

  4. [Added after EDIT, below]. Suppose I don't copy-and-paste outputs into inputs, and don't use @TraditionalForm in my inputs. If I set MMA to output TraditionalForm globally in Preferences -> Evaluation, is the evaluation of previous outputs always the same as it would be if my output were globally set to StandardForm?

int = Integrate[x^2, x]
%/x
Head[%%]
int/x
Head[int]
SameQ[int == x^3/3]
int = TraditionalForm@Integrate[x^2, x]
%/x
Head[%%]
int/x
Head[int]
SameQ[int == x^3/3]
added 8 characters in body
Source Link
theorist
  • 3.6k
  • 1
  • 16
  • 29

Note that, in the latter code block, when int is used in the subsequent input, MMA doesn't interpret it correctly (see Out[4] on RHS of screenshot). [Or, if you prefer, it interprets it differently from a StandardForm input and, according to Wolfram, StandardForm is, well, the standard for inputs.] By contrast, MMA is able to correctly interpret the output of int when it's instead referenced using % (see Out[2], RHS). Consistent with this, on the RHS of the screenshot, while the head of %% (which references the assignment ofline in which int was assigned) is Times (see Out[3]), the head of int itself is TraditionalForm (see Out[5]. By contrast, with the former code, where TraditionalForm is instead output globally, the heads of both %% and int are Times, and the use of TraditionalForm does not affect how the output is interpreted.

Note that, in the latter code block, when int is used in the subsequent input, MMA doesn't interpret it correctly (see Out[4] on RHS of screenshot). [Or, if you prefer, it interprets it differently from a StandardForm input and, according to Wolfram, StandardForm is, well, the standard for inputs.] By contrast, MMA is able to correctly interpret the output of int when it's instead referenced using % (see Out[2], RHS). Consistent with this, on the RHS of the screenshot, while the head of %% (which references the assignment of int ) is Times (see Out[3]), the head of int itself is TraditionalForm (see Out[5]. By contrast, with the former code, where TraditionalForm is instead output globally, the heads of both %% and int are Times, and the use of TraditionalForm does not affect how the output is interpreted.

Note that, in the latter code block, when int is used in the subsequent input, MMA doesn't interpret it correctly (see Out[4] on RHS of screenshot). [Or, if you prefer, it interprets it differently from a StandardForm input and, according to Wolfram, StandardForm is, well, the standard for inputs.] By contrast, MMA is able to correctly interpret the output of int when it's instead referenced using % (see Out[2], RHS). Consistent with this, on the RHS of the screenshot, while the head of %% (which references line in which int was assigned) is Times (see Out[3]), the head of int itself is TraditionalForm (see Out[5]. By contrast, with the former code, where TraditionalForm is instead output globally, the heads of both %% and int are Times, and the use of TraditionalForm does not affect how the output is interpreted.

deleted 5 characters in body
Source Link
theorist
  • 3.6k
  • 1
  • 16
  • 29
Loading
deleted 5 characters in body
Source Link
theorist
  • 3.6k
  • 1
  • 16
  • 29
Loading
deleted 5 characters in body
Source Link
theorist
  • 3.6k
  • 1
  • 16
  • 29
Loading
deleted 5 characters in body
Source Link
theorist
  • 3.6k
  • 1
  • 16
  • 29
Loading
added 39 characters in body
Source Link
theorist
  • 3.6k
  • 1
  • 16
  • 29
Loading
added 39 characters in body
Source Link
theorist
  • 3.6k
  • 1
  • 16
  • 29
Loading
added 39 characters in body
Source Link
theorist
  • 3.6k
  • 1
  • 16
  • 29
Loading
deleted 41 characters in body
Source Link
theorist
  • 3.6k
  • 1
  • 16
  • 29
Loading
added 3005 characters in body
Source Link
theorist
  • 3.6k
  • 1
  • 16
  • 29
Loading
added 3005 characters in body
Source Link
theorist
  • 3.6k
  • 1
  • 16
  • 29
Loading
added 3005 characters in body
Source Link
theorist
  • 3.6k
  • 1
  • 16
  • 29
Loading
added 63 characters in body
Source Link
theorist
  • 3.6k
  • 1
  • 16
  • 29
Loading
added 305 characters in body
Source Link
theorist
  • 3.6k
  • 1
  • 16
  • 29
Loading
Tweeted twitter.com/StackMma/status/812694873019125760
added 134 characters in body
Source Link
theorist
  • 3.6k
  • 1
  • 16
  • 29
Loading
edited tags
Source Link
theorist
  • 3.6k
  • 1
  • 16
  • 29
Loading
deleted 1855 characters in body; edited title
Source Link
theorist
  • 3.6k
  • 1
  • 16
  • 29
Loading
added 1948 characters in body
Source Link
theorist
  • 3.6k
  • 1
  • 16
  • 29
Loading
Source Link
theorist
  • 3.6k
  • 1
  • 16
  • 29
Loading