diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-10-05 05:49:02 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-10-05 05:49:02 +0000 |
commit | 809a9c5b6d1454e623e929afdf5a878bdb4023dc (patch) | |
tree | 952762873e59034c08b188b352c0ff8ff8b3a9f0 | |
parent | 8ff29f818c490db36474dd332efd3298320a5464 (diff) |
* 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
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | eval.c | 15 |
2 files changed, 21 insertions, 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 @@ -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); |