title: In Ruby, why after starting irb, foo.nil? says undefined error, and @foo.nil? gives "true", and @@wah.nil? gives error again?
body: <p>Same in Ruby 1.8.7 and 1.9.2:</p>
  
  <pre><code>$ irb
  
  ruby-1.8.7-p302 &gt; foo.nil?
  NameError: undefined local variable or method `foo' for #&lt;Object:0x3794c&gt;
      from (irb):1
  
  ruby-1.8.7-p302 &gt; @bar.nil?
   =&gt; true 
  
  ruby-1.8.7-p302 &gt; @@wah.nil?
  NameError: uninitialized class variable @@wah in Object
      from (irb):3
  </code></pre>
  
  <p>why the instance variable treated differently than a local and class variable?</p>