Contexts work sort of like namespaces. They're basically just prefixes to variable names. Whenever you use a new symbol, the "true" name of that symbol is longer than the name you explicitly gave it. The backtick is reserved for indicating context "paths". So, in a fresh session, if you evaluate
Context[]
you should get
Global`
Global is the default context. You can find out what symbols have been defined with Names
, and you can also specify a context to search in
Names["Global`*"]
{}
Names does pattern matching, so that *
is a wildcard. So this should show you all symbols that have been defined in the Global context (there are none yet).
The system "remembers" any new symbols you use, and automatically assigns them to the current context. If you evaluate the following
a
the system now is aware of the symbol a
, even though you didn't give it a value. Now try
Information["a"]
You should get a little panel that tells you the fulll name (Global`a). It would tell you any definitions, but right now there are none.
Now evaluate this
a = 7;
Information["a"]
and this time you should see that 7 has been assigned to a
. That brings us to ClearAll
. ClearAll
removes definitions, but leaves the symbol in the system's "memory".
ClearAll[a];
Information["a"]
Notice that the system still knows about Global
`a
, but it has forgotten all definitions. ClearAll
can work with raw symbols and with patterns. So, you could do this
ClearAll["Global`*"]
to conveniently clear definitions from all symbols in the Global
context. And
ClearAll["`*"]
removes all definitions for symbols in the current context (which should still be Global
if you've been following along).
You asked about
ClearAll["`Global"]
That would clear definitions for the symbol Global
in the current context. So, it would clear the symbol whose full name is Global
`Global
. Since we haven't defined such a symbol yet, nothing will actually happen.