public Method

Kernel.lambda

proc   { |...| block }   a_proc
lambda { |...| block }   a_proc

Equivalent to Proc.new, except the resulting Proc objects check the number of parameters passed when called.

Source Code

/*
* call-seq:
*   proc   { |...| block }  => a_proc
*   lambda { |...| block }  => a_proc
*
* Equivalent to <code>Proc.new</code>, except the resulting Proc objects
* check the number of parameters passed when called.
*/

static VALUE
proc_lambda()
{
   return proc_alloc(rb_cProc, Qtrue);
}
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.