title: Difference between lambda and def method_name in Ruby
body: <p>I am reading along in pickaxe 1.9 and the author uses lambda like this:</p>
  
  <pre><code>bo = lambda {|param| puts "You called me with #{param}"}
  bo.call 99     =&gt; 'You called me with 99'
  bo.call "cat"  =&gt; 'You called me with cat'
  </code></pre>
  
  <p>My question is this:  How is this any better/worse/different than just defining a method that does that same thing? Like so:</p>
  
  <pre><code>def bo(param)
    puts "You called me with #{param}"
  end
  
  bo("hello") =&gt; 'You called me with hello'
  </code></pre>
  
  <p>To me the lambda syntax seems much more confusing and spaghetti-like.</p>