title: Ruby - lambda vs. Proc.new
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1740046/whats-the-difference-between-a-proc-and-a-lambda-in-ruby">What&#39;s the difference between a proc and a lambda in Ruby?</a>  </p>
  </blockquote>
  
  
  
  <p>When  run this <code>Ruby</code> code:</p>
  
  <pre><code>def func_one
      proc_new = Proc.new {return "123"}
      proc_new.call
      return "456"
  end
  
  def func_two
      lambda_new = lambda {return "123"}
      lambda_new.call
      return "456"
  end
  
  puts "The result of running func_one is " + func_one
  puts ""
  puts "The result of running func_two is " + func_two
  </code></pre>
  
  <p>The result that I get is as follows:</p>
  
  <pre><code>The result of running func_one is 123
  
  The result of running func_two is 456
  </code></pre>
  
  <p>As for <code>func_two</code>, where is the the value of the <strong>first</strong> <code>return</code>, that is, <code>123</code>?</p>
  
  <p>Thanks.</p>