title: Ruby method, Proc, and block confusion
body: <p>I have a couple questions about Ruby's methods, procedures, and blocks that strike me as rather odd.  They're not so much about syntax or function as the logic behind the decisions made.</p>
  
  <p><em>Question 1:</em></p>
  
  <p>Why is it that blocks can be passed to methods (e.g. each) but they cannot be assigned to a variable?</p>
  
  <p>I know you can pass them around in procedures, i.e. <code>p = Proc.new {...}</code> (accessed with <code>&amp;p</code>), but it doesn't make much sense to make the programmer go through these means.</p>
  
  <p><em>Question 2:</em></p>
  
  <p>Why is there a differentiation between methods and procedures?</p>
  
  <p>For instance, I can accomplish the task of defining a function and calling that function in the following two ways:</p>
  
  <pre><code>def square(x)
      x**2
  end
  
  square(3)
  =&gt; 9
  </code></pre>
  
  <p>or</p>
  
  <pre><code>square = lambda {|x| x**2}
  square.call(3)
  =&gt; 9
  </code></pre>
  
  <p>Why the differentiation?  In Python for example both defining a function in the standard way and by <code>square = lambda x: x**2</code> accomplish the same task of creating the function and assigning it to <code>square</code>.</p>