Starting a fresh kernel and writing the following set of commands:
Define a new context temp and a variable name x in it.
temp`x=2;
Next define a global variable with the same name.
x=1;
Next I run the following commands sequentially and separately so that parser does not use the same context throughout.
Begin["temp`"];
Print[{x, Global`x, temp`x}];
End[];
I get {1, 1, 2} but was expecting {2, 1, 2}.
If I look at $ContextPath, temp doesn't exist in it.
$ContextPath: "...is a global variable that gives a list of contexts to search, before $Context, in trying to find a symbol that has been entered.". – halirutan Jun 19 '18 at 10:59tempthen shouldn'txcorrespond to temp`x not Global`x. – user13892 Jun 19 '18 at 11:05System`namespace, because no sane user understands how to work with contexts. Fact is, you can get a pretty decent understanding of how everything works by reading the documentation ofBegin,BeginPackage,$Context, and$ContextPath. You will remember this for the rest of ... the next few days. Then you look it up again. Sorry, but unfortunately, that's how it is. – halirutan Jun 19 '18 at 11:13