From: Joseph Jones Date: 2015-12-17T21:12:58-07:00 Subject: [ruby-core:72326] [Ruby trunk - Bug #11648] Undocumented features of String#oct --567387ca_60ef0119_16c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Joseph Jones liked your message with Boxer. On December 14, 2015 at 05:43= :34 MST, yugui=40yugui.jp wrote:Issue =2311648 has been updated by Yuki S= onoda.Assignee set to Yukihiro MatsumotoIt is surprising for me too. But = this behavior was introduced in r373 by intention.I hope Matz remembers t= he original intention.I guess Ruby followed the behavior of Perl and it w= as useful to handle string representation of file permissions=3F---------= -------------------------------Bug =2311648: Undocumented features of Str= ing=23octhttps://bugs.ruby-lang.org/issues/11648=23change-55532* Author: = Mike Pastore* Status: Open* Priority: Normal* Assignee: Yukihiro Matsumot= o* ruby -v: ruby 2.2.3p173 (2015-08-18 revision 51636) =5Bx86=5F64-linux=5D= * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN-------------------= ---------------------String=23oct will adjust the base of the stringy num= ber being converted to 2 (if prefixed with 0B), 8 (also the default, if p= refixed with 0O), 10 (if prefixed with 0D), or 16 (if prefixed with 0X). = Much to my surprise this behavior is not documented at ruby-doc.org =5B1=5D= . Is this the intended behavior and if so should the documentation be upd= ated=3F If it is not the intended behavior, perhaps String=23oct should r= aise an exception if someone tries to use this undocumented feature=3F 1.= http://ruby-doc.org/core-2.2.3/String.html=23method-i-oct-- https://bugs= .ruby-lang.org/ --567387ca_60ef0119_16c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Joseph Jones liked your message with Boxer.


= On December 14, 2015 at 05:43:34 MST, yugui=40yugui.jp wrote:
Issue =2311648 has been updated b= y Yuki Sonoda.

Assignee set to Yukihiro Matsumoto

I= t is surprising for me too. But this behavior was introduced in r373 by = intention.
I hope Matz remembers the original intention.

= I guess Ruby followed the behavior of Perl and it was useful to handle st= ring representation of file permissions=3F

-------------------= ---------------------
Bug =2311648: Undocumented features of String=23= oct
https://bugs.ruby-lang.org/issues/11648=23change-55532

* Author: Mike Pastore
* Status: Open
* Priority: Normal
* Assignee: Yukihiro Matsumoto
* ruby -v: ruby 2.2.3p173 (2015-08-1= 8 revision 51636) =5Bx86=5F64-linux=5D
* Backport: 2.0.0: UNKNOWN, 2= .1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------String=23oct will adjust the base of the stringy number being convert= ed to 2 (if prefixed with 0B), 8 (also the default, if prefixed with 0O),= 10 (if prefixed with 0D), or 16 (if prefixed with 0X). Much to my surpri= se this behavior is not documented at ruby-doc.org =5B1=5D. Is this the i= ntended behavior and if so should the documentation be updated=3F If it i= s not the intended behavior, perhaps String=23oct should raise an excepti= on if someone tries to use this undocumented feature=3F

1. ht= tp://ruby-doc.org/core-2.2.3/String.html=23method-i-oct


=
--
https://bugs.ruby-lang.org/
= --567387ca_60ef0119_16c--