ruby-changes:11942
From: nobu <ko1@a...>
Date: Fri, 29 May 2009 17:10:24 +0900 (JST)
Subject: [ruby-changes:11942] Ruby:r23606 (trunk): * struct.c (Init_Struct): made #to_s an alias to #inspect to
nobu 2009-05-29 17:10:10 +0900 (Fri, 29 May 2009) New Revision: 23606 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=23606 Log: * struct.c (Init_Struct): made #to_s an alias to #inspect to reduce the result of recursive struct. a patch from ujihisa at [ruby-dev:38554]. Modified files: trunk/ChangeLog trunk/struct.c Index: ChangeLog =================================================================== --- ChangeLog (revision 23605) +++ ChangeLog (revision 23606) @@ -1,7 +1,13 @@ +Fri May 29 17:10:08 2009 Nobuyoshi Nakada <nobu@r...> + + * struct.c (Init_Struct): made #to_s an alias to #inspect to + reduce the result of recursive struct. a patch from ujihisa a + [ruby-dev:38554]. + Fri May 29 17:08:23 2009 Nobuyoshi Nakada <nobu@r...> * hash.c (Init_Hash): made #to_s an alias to #inspect to reduce - the result of recursive array. a patch from ujihisa a + the result of recursive hash. a patch from ujihisa a [ruby-core:23601]. [ruby-dev:38555] Fri May 29 09:30:00 2009 Nobuyoshi Nakada <nobu@r...> Index: struct.c =================================================================== --- struct.c (revision 23605) +++ struct.c (revision 23606) @@ -900,8 +900,8 @@ rb_define_method(rb_cStruct, "eql?", rb_struct_eql, 1); rb_define_method(rb_cStruct, "hash", rb_struct_hash, 0); - rb_define_method(rb_cStruct, "to_s", rb_struct_inspect, 0); rb_define_method(rb_cStruct, "inspect", rb_struct_inspect, 0); + rb_define_alias(rb_cStruct, "to_s", "inspect"); rb_define_method(rb_cStruct, "to_a", rb_struct_to_a, 0); rb_define_method(rb_cStruct, "values", rb_struct_to_a, 0); rb_define_method(rb_cStruct, "size", rb_struct_size, 0); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/