diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-05-29 08:10:10 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-05-29 08:10:10 +0000 |
| commit | f3ab97a87915a52545fa9947911db41cad8bc781 (patch) | |
| tree | 07e068a361a493b1dde9ea7b7f2ba95209e9db55 | |
| parent | 5561c5f5c174cc7b653ece1a972c3c175904fd7e (diff) | |
| download | ruby-f3ab97a87915a52545fa9947911db41cad8bc781.tar.gz ruby-f3ab97a87915a52545fa9947911db41cad8bc781.tar.xz ruby-f3ab97a87915a52545fa9947911db41cad8bc781.zip | |
* 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].
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23606 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 8 | ||||
| -rw-r--r-- | struct.c | 2 |
2 files changed, 8 insertions, 2 deletions
@@ -1,7 +1,13 @@ +Fri May 29 17:10:08 2009 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * 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@ruby-lang.org> * 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@ruby-lang.org> @@ -900,8 +900,8 @@ Init_Struct(void) 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); |
