title: The `+` in ruby
body: <p>I am new in ruby, and I am reading the <code>Progamming Ruby</code> and following its examples.</p>
  
  <p>This is the codes which teach the <code>Inheritance and Messages</code>:</p>
  
  <pre><code>class Song
    def initialize(name, artist, duration)
      @name=name;
      @artist=artist;
      @duration=duration;
    end
  
    def to_s
      "Song:#@name \t#@artist\t#@duration"
    end
  end
  
  class KaraokeSong &lt; Song
    def initialize(name, artist, duration, lyrics)
      super(name, artist, duration);
      @lyrics=lyrics;
    end
  
    def to_s
      super + "[#@lyrics]";
    end
  end
  
  song=KaraokeSong.new("There for me", "Sarah", 2320, "There for me, every time I've been away...")
  puts song.to_s
  </code></pre>
  
  <p>This codes works fine.</p>
  
  <p>However I found that if I change the <code>to_s</code> of <code>KaraokeSong</code> to this(Note there is no space between the <code>+</code> and the <code>"[#@lyrics]"</code>):</p>
  
  <pre><code>  def to_s
      super +"[#@lyrics]";
    end
  </code></pre>
  
  <p>I will get the error:</p>
  
  <blockquote>
    <p>in <code>to_s': undefined method</code>+@' for "[There for me, every time I've
    been away...]":String (NoMethodError)</p>
  </blockquote>
  
  <p>But then I make a test:</p>
  
  <pre><code>name="kk"
  puts name +"sfds"
  </code></pre>
  
  <p>This codes does not throw any errors.</p>
  
  <p>What's the problem?</p>
  
  <p>BTW, I am using <code>ruby 2.0.0p247 (2013-06-27) [x64-mingw32]</code></p>