@@ -481,6 +481,14 @@ rb_block_proc(void)
481481 return proc_new (rb_cProc , FALSE);
482482}
483483
484+ /*
485+ * call-seq:
486+ * lambda { |...| block } -> a_proc
487+ *
488+ * Equivalent to <code>Proc.new</code>, except the resulting Proc objects
489+ * check the number of parameters passed when called.
490+ */
491+
484492VALUE
485493rb_block_lambda (void )
486494{
@@ -494,20 +502,6 @@ rb_f_lambda(void)
494502 return rb_block_lambda ();
495503}
496504
497- /*
498- * call-seq:
499- * lambda { |...| block } -> a_proc
500- *
501- * Equivalent to <code>Proc.new</code>, except the resulting Proc objects
502- * check the number of parameters passed when called.
503- */
504-
505- static VALUE
506- proc_lambda (void )
507- {
508- return rb_block_lambda ();
509- }
510-
511505/* Document-method: ===
512506 *
513507 * call-seq:
@@ -952,7 +946,7 @@ mnew(VALUE klass, VALUE obj, ID id, VALUE mclass, int scope)
952946 again :
953947 me = rb_method_entry_without_refinements (klass , id , & defined_class );
954948 if (UNDEFINED_METHOD_ENTRY_P (me )) {
955- ID rmiss = rb_intern ( "respond_to_missing?" ) ;
949+ ID rmiss = idRespond_to_missing ;
956950 VALUE sym = ID2SYM (id );
957951
958952 if (obj != Qundef && !rb_method_basic_definition_p (klass , rmiss )) {
@@ -1993,13 +1987,13 @@ method_inspect(VALUE method)
19931987static VALUE
19941988mproc (VALUE method )
19951989{
1996- return rb_funcall ( Qnil , rb_intern ( "proc" ) , 0 );
1990+ return rb_funcall2 ( rb_mRubyVMFrozenCore , idProc , 0 , 0 );
19971991}
19981992
19991993static VALUE
20001994mlambda (VALUE method )
20011995{
2002- return rb_funcall (Qnil , rb_intern ( "lambda" ) , 0 );
1996+ return rb_funcall (rb_mRubyVMFrozenCore , idLambda , 0 , 0 );
20031997}
20041998
20051999static VALUE
@@ -2339,7 +2333,7 @@ Init_Proc(void)
23392333
23402334 /* utility functions */
23412335 rb_define_global_function ("proc" , rb_block_proc , 0 );
2342- rb_define_global_function ("lambda" , proc_lambda , 0 );
2336+ rb_define_global_function ("lambda" , rb_block_lambda , 0 );
23432337
23442338 /* Method */
23452339 rb_cMethod = rb_define_class ("Method" , rb_cObject );
0 commit comments