32
$\begingroup$

Bug introduced in 10 and persisting through 12.0.0


Assume the following simple expression

{#"Test"}&

Now go in front of the # and just start typing another named slot expression. On my system, the front end invalidates the input by magically inserting invisible characters

Mathematica graphics

For a real cool demonstration, look at this

enter image description here

My system is: Mathematica 10.2 on Ubuntu 14.04

Update:

Official response of WRI confirms that it is a bug:

Thank you for taking the time to send in this report. It does appear that entering an additional string (quotation marks) is causing an issue with the front end's box structure, and I have forwarded an incident report to our developers with the information you provided.

$\endgroup$
  • $\begingroup$ Do you think this is related to what happens here and in the question I linked in the comments? $\endgroup$ – march Sep 24 '15 at 3:23
  • $\begingroup$ I get exactly the same results with Mathematica 10.2 on Windows 7 x64. $\endgroup$ – WReach Sep 24 '15 at 3:34
  • 3
    $\begingroup$ Yes, I believe they are strongly related. What seems to happen is that when you open quotes and insert a string, the front end has to take the rest of your whole expression as string, because you haven't inserted the closing quotes yet. The moment you close the quotes, the front end rebuilds a wrong box-structure of your expression. This happens in my example and it happens in yours. You can easily verify this yourself. $\endgroup$ – halirutan Sep 24 '15 at 3:34
  • $\begingroup$ @march And if you don't know how to verify this, then just use a minimal example like this "a"(a )^2. Take one version that you copy and another version that you type by inserting the string at last. Then, look at both expressions by pressing Ctrl+Shift+E to show the box structure. You will see that the SupercriptBox does not contain the correct elements. $\endgroup$ – halirutan Sep 24 '15 at 3:40
  • 2
    $\begingroup$ Yes I see. Interestingly enough, as @MarcoB points out in that post, the formatted superscript is necessary for that example, which doesn't seem to be the case for yours. I've seen cases where the # will lose track of its corresponding & and turn pink when, for instance, I introduce new formatted fraction signs in an expression (although I'm having trouble reproducing that right now). Point being: it doesn't seem to be just quotes causing problems. I'll try my best to find an example... $\endgroup$ – march Sep 24 '15 at 3:49

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.