mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* eval.c (proc_s_new): revived.
* eval.c (Init_Proc): define Proc.new instead of Proc.allocate to inhibit from creating uninitialized Proc. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1771 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
8ff29f818c
commit
809a9c5b6d
2 changed files with 21 additions and 1 deletions
|
@ -1,3 +1,10 @@
|
|||
Fri Oct 5 11:59:13 2001 Nobuyoshi Nakada <nobu.nakada@nifty.ne.jp>
|
||||
|
||||
* eval.c (proc_s_new): revived.
|
||||
|
||||
* eval.c (Init_Proc): define Proc.new instead of Proc.allocate to
|
||||
inhibit from creating uninitialized Proc.
|
||||
|
||||
Thu Oct 4 14:11:03 2001 WATANABE Hirofumi <eban@ruby-lang.org>
|
||||
|
||||
* ext/socket/socket.c (ruby_connect): EALREADY is the equivalent
|
||||
|
|
15
eval.c
15
eval.c
|
@ -6364,6 +6364,18 @@ proc_new(klass)
|
|||
return proc;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
proc_s_new(argc, argv, klass)
|
||||
int argc;
|
||||
VALUE *argv;
|
||||
VALUE klass;
|
||||
{
|
||||
VALUE proc = proc_new(klass);
|
||||
|
||||
rb_obj_call_init(proc, argc, argv);
|
||||
return proc;
|
||||
}
|
||||
|
||||
VALUE
|
||||
rb_f_lambda()
|
||||
{
|
||||
|
@ -6969,7 +6981,8 @@ Init_Proc()
|
|||
rb_eSysStackError = rb_define_class("SystemStackError", rb_eStandardError);
|
||||
|
||||
rb_cProc = rb_define_class("Proc", rb_cObject);
|
||||
rb_define_singleton_method(rb_cProc, "allocate", proc_new, 0);
|
||||
rb_undef_method(CLASS_OF(rb_cProc), "allocate");
|
||||
rb_define_singleton_method(rb_cProc, "new", proc_s_new, -1);
|
||||
|
||||
rb_define_method(rb_cProc, "call", proc_call, -2);
|
||||
rb_define_method(rb_cProc, "yield", proc_yield, -2);
|
||||
|
|
Loading…
Reference in a new issue