5

screenshot

Using this code,you can see,same input, but the output are different. So weird!

If I copy this code here, it outputs normally. So what's the problem?

Ps:I use "10.4.0 for Microsoft Windows (64-bit) (February 26, 2016)".

I want to show how to reproduce this phenomenon. enter image description here

partida
  • 6,816
  • 22
  • 48
  • Reproduced in v9.0.1 and v8.0.4… how did you create these? – xzczd May 09 '16 at 12:12
  • @xzczd When I read the http://www.mathprogramming-intro.org/download/MathProgrammingIntro.pdf,it is the first code in the section 4.2.4.8. – partida May 09 '16 at 12:16
  • If you look at the box expressions of the two lines, they are different. This is perhaps caused by pasting code from that pdf file – vapor May 09 '16 at 13:58
  • @happyfish I didn't copy it from pdf file.I type it letter by letter. – partida May 09 '16 at 14:01
  • @partida don't know how you created this, but the first line is RowBox[{RowBox[{"f_", "[", "t__", "]"}], "/;", "f"}], and the second is RowBox[{RowBox[{"f_", "[", "t__", "]"}], "/;", RowBox[{"f", "=!=", "List"}]}], that explains the difference – vapor May 09 '16 at 14:05
  • @happyfish But they look same in FrontEnd,isn't it? – partida May 09 '16 at 14:18
  • @happyfish But they look same in FrontEnd,isn't it? – partida May 09 '16 at 14:18
  • @partida That's true, but it does not mean it is a bug (or at least you can't conclude only with this reason). Expressions with different RowBox structures can look the same. And if you have played with InterpretationBox, you can produce things like 1+1=3, and that 1+1 looks identical to the normal one. – vapor May 09 '16 at 14:20
  • @happyfish Thank you. I have no experence with RowBox before.I untag the "bugs". – partida May 09 '16 at 14:24
  • 1
    @partida Whether it is a bug depends on how you created it. If all these can be done by typing and you can tell a reproducible procedure, it is likely to be a bug. – vapor May 09 '16 at 14:25
  • @happyfish Ok,I will try to reproduce the procedure of typing. – partida May 09 '16 at 14:27
  • My guess: when you enter the symbol =!=, first you enter =, and mathematica will group this expression as set expression, even if you add additional !=. When you type a space (after or before), it will reconstruct the RowBox expression (to be the correct one). This behavior is strange, maybe wait for some senior users to comment. – vapor May 09 '16 at 17:05
  • It looks like a bug in front end. Actually, just wrapping the expression by Hold and execute, then delete the Hold, you will find the expression can be executed correctly. – Kattern May 10 '16 at 02:30
  • @Kattern even if you do more subtle changes, like retyping some letter, it will be correct. – vapor May 10 '16 at 10:16

0 Answers0