title: Equivalent of "defined" in Mathematica
body: <p>I need a function that takes the name of a symbol as a string and returns whether that symbol is already defined.  The function <code>ValueQ</code> is close but it returns False for function names. Also, it takes symbols rather than strings.</p>
  
  <p>Examples:</p>
  
  <pre><code>defined["N"] --&gt; True (predefined function N)
  defined["x"] --&gt; False
  x = 7;
  defined["x"] --&gt; True (x is now defined)
  defined["7"] --&gt; True (7 is a number)
  f[x_] := 2x
  defined["f"] --&gt; True (f has DownValues)
  g[x_][y_] := x+y
  defined["g"] --&gt; True (g has SubValues)
  </code></pre>
  
  <p>PS: Thanks to Pillsy for pointing out the need to check for both DownValues and SubValues.</p>