This code works as expected (does nothing, even doesn't produce warning/errors):
l = lambda {|i|}
l.call(1)
This code produces warning (warning: multiple values for a block parameter (0 for 1)):
l = lambda {|i|}
l.call
And this code fails with error (ArgumentError: wrong number of arguments (0 for 2)):
l = lambda {|i, y|}
l.call
I thought that lambda requires all argument to be passed.
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?
PS: ruby 1.8.6 (2008-08-11 patchlevel 287) [universal-darwin9.0]
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 <=1.8)