Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
Kernel#lambda
() { () -> untyped } -> ::Proc
lambda { |...| block } → a_proc
proc.c
View on GitHub ↗
static VALUE
f_lambda(VALUE _)
{
f_lambda_filter_non_literal();
return rb_block_lambda();
}
Equivalent to Proc.new, except the resulting Proc objects check the number of parameters passed when called.
Ruby version changes
-
3.0
-
Kernel#lambdanow warns if called without a literal block. [Feature #15973]
-