From bfb47068b0a888aa82ad027aadb36828ac396683 Mon Sep 17 00:00:00 2001 From: matz Date: Thu, 18 Mar 2004 06:59:04 +0000 Subject: * eval.c: remove specialized version of rb_Array(). use simple one defined in object.c. * object.c (Init_Object): remove Kernel#to_a. * enum.c (enum_zip): use "to_a" instead of "to_ary". git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5968 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- object.c | 28 ---------------------------- 1 file changed, 28 deletions(-) (limited to 'object.c') diff --git a/object.c b/object.c index bbc9ec5390..0e7801fe77 100644 --- a/object.c +++ b/object.c @@ -178,7 +178,6 @@ rb_obj_type(obj) return rb_class_real(CLASS_OF(obj)); } - /* * call-seq: * obj.class => class @@ -316,30 +315,6 @@ rb_obj_init_copy(obj, orig) return obj; } -/* - * call-seq: - * obj.to_a -> anArray - * - * Returns an array representation of obj. For objects of class - * Object and others that don't explicitly override the - * method, the return value is an array containing self. - * However, this latter behavior will soon be obsolete. - * - * self.to_a #=> -:1: warning: default `to_a' will be obsolete - * "hello".to_a #=> ["hello"] - * Time.new.to_a #=> [39, 54, 8, 9, 4, 2003, 3, 99, true, "CDT"] - */ - - -static VALUE -rb_any_to_a(obj) - VALUE obj; -{ - rb_warn("default `to_a' will be obsolete"); - return rb_ary_new3(1, obj); -} - - /* * call-seq: * obj.to_s => string @@ -2322,7 +2297,6 @@ rb_f_string(obj, arg) return rb_String(arg); } -#if 0 VALUE rb_Array(val) VALUE val; @@ -2345,7 +2319,6 @@ rb_Array(val) } return tmp; } -#endif /* * call-seq: @@ -2507,7 +2480,6 @@ Init_Object() rb_define_method(rb_mKernel, "freeze", rb_obj_freeze, 0); rb_define_method(rb_mKernel, "frozen?", rb_obj_frozen_p, 0); - rb_define_method(rb_mKernel, "to_a", rb_any_to_a, 0); /* to be removed */ rb_define_method(rb_mKernel, "to_s", rb_any_to_s, 0); rb_define_method(rb_mKernel, "inspect", rb_obj_inspect, 0); rb_define_method(rb_mKernel, "methods", rb_obj_methods, -1); -- cgit v1.2.3