title: Ruby lambda arguments
body: <p>This code works as expected (does nothing, even doesn't produce warning/errors):</p>
  
  <pre><code>l = lambda {|i|}
  l.call(1)
  </code></pre>
  
  <p>This code produces warning (warning: multiple values for a block parameter (0 for 1)):</p>
  
  <pre><code>l = lambda {|i|}
  l.call
  </code></pre>
  
  <p>And this code fails with error (ArgumentError: wrong number of arguments (0 for 2)):</p>
  
  <pre><code>l = lambda {|i, y|}
  l.call
  </code></pre>
  
  <p>I thought that lambda requires all argument to be passed.</p>
  
  <p>And from the second example I see that it isn't. Why does it work when only one argument is given, and works as expected (fails with error) with more than one argument?</p>
  
  <p>PS: ruby 1.8.6 (2008-08-11 patchlevel 287) [universal-darwin9.0]</p>
  
  <p>UPDATE: I've checked these samples with ruby 1.9.1p376. And it works as expected - the second example also produces an error. Looks like this is a feature of 1.8 version (or &lt;=1.8)</p>