# See currently assigned variables in Mathematica

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.

-
?Global* works. – J. M. Dec 22 '11 at 6:52

## 1 Answer

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] =!= {} &]

-