12

When you write this code:

tab = {{1, 1}}; tab = Join[tab, {{2,2}}];

you expect to get the following table:

{{1, 1}, {2, 2}}

but, if you write the following code instead:

tab = {{1, 1}}; tab = Join[tab, {{2, 2}}]; ListPlot[tab]

and after that, you check the elements of tab, it will contain these elements:

{{1, 1}, {2, 2}, {2, 2}}

Why does it happen? Is it a kind of bug of Mathematica, or I do not understand how the Join function works? (I'm running version 10.0.0 on Windows 10.)

Here I post a screenshot

mmal
  • 3,508
  • 2
  • 18
  • 38
Francisco
  • 609
  • 3
  • 11

1 Answers1

9

As Mr. Wizard wisely suggested in his comment, the Suggestion Bar feature is the source of this bug. I have confirmed that turning it off removes the bug.

The canonical answer for Suggestion Bar troubles is found here. It shows how to turn it off, under Preferences > Interface.

C. E.
  • 70,533
  • 6
  • 140
  • 264