Actions
Feature #11300
closed[PATCH] Add String#bin for parity with #hex and #oct.
Feature #11300: [PATCH] Add String#bin for parity with #hex and #oct.
Status:
Feedback
Assignee:
-
Target version:
-
Description
Files
Actions
Added by 0x0dea (D.E. Akers) over 10 years ago. Updated over 6 years ago.
Description
Files
| string_bin.patch (2.17 KB) string_bin.patch | 0x0dea (D.E. Akers), 06/24/2015 01:00 AM |
Two points. Unlike #hex and #oct, there's little demand for 0/1 strings conversion.
Besides that, String#bin can be easily confused with "binary (raw) encoding" and cause more surprise.
Any opinion?
Matz.
matz@ruby-lang.org wrote:
Two points. Unlike
#hexand#oct, there's little demand for 0/1 strings conversion.
Besides that,String#bincan be easily confused with "binary (raw) encoding" and cause more surprise.
Any opinion?
I agree it is potentially confusing with String#b and redundant.
I even wish redundant methods like String#hex and String#oct can go away,
too; String#to_i is enough.