It seems that we can change the context of symbols:
In:= x = 1 Out= 1 In:= Context[x] = "foo`";
x is still interpreted as
foo`x (and not
Global`x) even though
foo` is not in
In:= x Out= 1 In:= foo`x Out= 1
The behaviour is not consistent though. At other times I randomly get this when evaluating the same sequence of expressions in a new kernel:
In:= x = 1 Out= 1 In:= Context[x] = "foo`"; In:= x Out= x In:= foo`x Out= 1
I see this random, erratic behaviour in M9, 10 and 10.1. In M8,
x is not seen any more as soon as its context is changed, i.e. it behaves as one would expect.
- Why the random behaviour?
- Is it documented or discussed anywhere that
Contextan be changed?