Feature #13502
openremove unused Array#to_s implementation
Description
Hello Ruby Team!
First time i've make a commit request, hopefully not the last :)
While browsing the src of ruby, specifically array.c i noticed that Array#to_s is an alias of Array#inspect but the implementation of Array#to_s still remains in src.
I tried to find a reason why the implementation still remains in src without any luck but let me know if there is a reason why.
- array.c: remove rb_ary_to_s function and remove static keyword from rb_ary_inspect
- include/ruby/intern.h: declare rb_ary_inspect and alias rb_ary_to_s to rb_ary_inspect
Thanks in advance.
Files
Updated by colby (Colby Swandale) over 7 years ago
- File deleted (
0001-remove-array-to_s-implementation)
Updated by colby (Colby Swandale) over 7 years ago
- File 0001-remove-array-to_s-implementation.patch added
Updated by normalperson (Eric Wong) over 7 years ago
Thanks for the report. I think we need to keep an alias for
rb_ary_to_s in intern.h for backwards-compatibility. intern.h
is (unfortunately) part of the public API which 3rd-party
extensions may depend on.
Perhaps use the RUBY_ALIAS_FUNCTION macro to preserve the
alias in intern.h, but remove it from array.c.
Thanks.
Updated by colby (Colby Swandale) over 7 years ago
Thanks for the feedback Eric. I'll work on that.
Updated by colby (Colby Swandale) over 7 years ago
- File 0001-remove-array-to_s-implementation.patch added
- Description updated (diff)
Updated by colby (Colby Swandale) over 7 years ago
- File deleted (
0001-remove-array-to_s-implementation.patch)
Updated by colby (Colby Swandale) over 7 years ago
Updated by colby (Colby Swandale) over 7 years ago
- File deleted (
0001-remove-array-to_s-implementation.patch)
Updated by hsbt (Hiroshi SHIBATA) over 3 years ago
- Tracker changed from Misc to Feature