title: ${BASH_SOURCE[0]} equivalent in zsh?
body: <p>The title should say it all. I'm looking for an equivalent to <code>${BASH_SOURCE[0]}</code> in zsh.</p>
  
  <p><em>Note:</em> I keep finding "<code>$0</code> is equivalent to <code>${BASH_SOURCE[0]}</code>" around the Internet, but this seems to be false: <code>$0</code> seems to be the name of the executing command. (It's <code>argv[0]</code>, which makes sense.) Echoing $0 in my script (<code>.zshrc</code>) gives <code>zsh</code> for <code>$0</code>, which isn't the same as what <code>${BASH_SOURCE[0]}</code> is. In fact, <code>${BASH_SOURCE[0]}</code> seems to work in <code>zsh</code>, except for inside <code>.zshrc</code> files.</p>
  
  <p><em>What I'm really doing in my <code>.zshrc</code> (that isn't working):</em></p>
  
  <pre><code>echo ${BASH_SOURCE[0]}
  source `dirname $0`/common-shell-rc.sh
  </code></pre>
  
  <p>The source fails (<code>$0</code> is <code>zsh</code>) and the <code>echo</code> outputs a blank line.</p>
  
  <p><strong>Edit:</strong> <strike>apparently, for <code>$0</code> to work, I need the option <code>FUNCTION_ARGZERO</code> option set. Any way to test if this is set in a script? (so that I can temporarily set it)</strike> It is apparently on unless you set <code>nofunction_argzero</code>, and it is on in my shell. Still get nothing for <code>$0</code>. (I think b/c I'm not in a function.)</p>