1
$\begingroup$

I've noticed that in a notebook, if I define a variable, and then delete the definition, the variable stays assigned. Is there a quick way to see all the variables that are assigned? I can find them by using the debugger, but it is kind of tedious for a quick check.

  • 2
    `?Global\`*` works.2011-12-22

1 Answers 1

1

Mathematica associates with each symbol a set of values. OwnValues is the one that stores value assignments to the symbol.

This code returns the list of symbol names (as strings) for those symbols whose OwnValues is non-empty, i.e. the symbol has been assigned a value:

Select[Names["Global`*"],   ToExpression[#, InputForm, OwnValues] =!= {} &]