8

I create a lot of symbols, and then I move on to my next set of manipulations. I noticed that symbols from prior sessions are still around. I have no idea how many symbols are in my context, but there must be a lot of them. How can I see what symbols I have lying around?

I see that

Names["*"] 

will give me a list of all symbols, but that includes the upper-case system symbols, which I don't want to see.

corey979
  • 23,947
  • 7
  • 58
  • 101
Gene Naden
  • 327
  • 2
  • 9

1 Answers1

12

User defined symbols/functions are in the Global` context:

a = 1;
b[x_] := a x^2;
c[x_] := f[x];

Names["Global`*"]

{"a", "b", "c", "f", "x"}

corey979
  • 23,947
  • 7
  • 58
  • 101
  • 2
    I would argue that, in fact, neither f nor x are user-defined symbols in your example. I would only consider a, b, c to be. Given the accept, I guess OP would disagree with me though. – AccidentalFourierTransform Jul 22 '18 at 01:36
  • 4
    @AccidentalFourierTransform The other problem I see is that not all user-defined symbols are in the Global context. This probably suffices for many purposes but it's not really robust. – Mr.Wizard Jul 22 '18 at 06:07