ruby-changes:7995
From: nobu <ko1@a...>
Date: Wed, 24 Sep 2008 17:05:13 +0900 (JST)
Subject: [ruby-changes:7995] Ruby:r19519 (trunk): * complex.c (Init_Complex), rational.c (Init_Rational): ID_ALLOCATOR
nobu 2008-09-24 17:02:17 +0900 (Wed, 24 Sep 2008) New Revision: 19519 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=19519 Log: * complex.c (Init_Complex), rational.c (Init_Rational): ID_ALLOCATOR differs from :allocate, and invisible in ruby level. Modified files: trunk/ChangeLog trunk/complex.c trunk/rational.c Index: complex.c =================================================================== --- complex.c (revision 19518) +++ complex.c (revision 19519) @@ -1371,17 +1371,10 @@ rb_cComplex = rb_define_class(COMPLEX_NAME, rb_cNumeric); rb_define_alloc_func(rb_cComplex, nucomp_s_alloc); - rb_funcall(rb_cComplex, rb_intern("private_class_method"), 1, - ID2SYM(rb_intern("allocate"))); #if 0 - rb_define_singleton_method(rb_cComplex, "new!", nucomp_s_new_bang, -1); - rb_funcall(rb_cComplex, rb_intern("private_class_method"), 1, - ID2SYM(rb_intern("new!"))); - - rb_define_singleton_method(rb_cComplex, "new", nucomp_s_new, -1); - rb_funcall(rb_cComplex, rb_intern("private_class_method"), 1, - ID2SYM(rb_intern("new"))); + rb_define_private_method(CLASS_OF(rb_cComplex), "new!", nucomp_s_new_bang, -1); + rb_define_private_method(CLASS_OF(rb_cComplex), "new", nucomp_s_new, -1); #else rb_undef_method(CLASS_OF(rb_cComplex), "new"); #endif @@ -1472,9 +1465,7 @@ rb_define_method(rb_cString, "to_c", string_to_c, 0); - rb_define_singleton_method(rb_cComplex, "convert", nucomp_s_convert, -1); - rb_funcall(rb_cComplex, rb_intern("private_class_method"), 1, - ID2SYM(rb_intern("convert"))); + rb_define_private_method(CLASS_OF(rb_cComplex), "convert", nucomp_s_convert, -1); /* --- */ Index: ChangeLog =================================================================== --- ChangeLog (revision 19518) +++ ChangeLog (revision 19519) @@ -1,3 +1,8 @@ +Wed Sep 24 17:02:14 2008 Nobuyoshi Nakada <nobu@r...> + + * complex.c (Init_Complex), rational.c (Init_Rational): ID_ALLOCATOR + differs from :allocate, and invisible in ruby level. + Wed Sep 24 15:58:52 2008 Yukihiro Matsumoto <matz@r...> * string.c (rb_str_rstrip_bang): removing mixed spaces and nuls at Index: rational.c =================================================================== --- rational.c (revision 19518) +++ rational.c (revision 19519) @@ -1488,17 +1488,10 @@ rb_cRational = rb_define_class(RATIONAL_NAME, rb_cNumeric); rb_define_alloc_func(rb_cRational, nurat_s_alloc); - rb_funcall(rb_cRational, rb_intern("private_class_method"), 1, - ID2SYM(rb_intern("allocate"))); #if 0 - rb_define_singleton_method(rb_cRational, "new!", nurat_s_new_bang, -1); - rb_funcall(rb_cRational, rb_intern("private_class_method"), 1, - ID2SYM(rb_intern("new!"))); - - rb_define_singleton_method(rb_cRational, "new", nurat_s_new, -1); - rb_funcall(rb_cRational, rb_intern("private_class_method"), 1, - ID2SYM(rb_intern("new"))); + rb_define_private_method(CLASS_OF(rb_cRational), "new!", nurat_s_new_bang, -1); + rb_define_private_method(CLASS_OF(rb_cRational), "new", nurat_s_new, -1); #else rb_undef_method(CLASS_OF(rb_cRational), "new"); #endif @@ -1574,9 +1567,7 @@ rb_define_method(rb_cString, "to_r", string_to_r, 0); - rb_define_singleton_method(rb_cRational, "convert", nurat_s_convert, -1); - rb_funcall(rb_cRational, rb_intern("private_class_method"), 1, - ID2SYM(rb_intern("convert"))); + rb_define_private_method(CLASS_OF(rb_cRational), "convert", nurat_s_convert, -1); } /* -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/