From: Aaron Patterson Date: 2011-02-17T10:48:38+09:00 Subject: [ruby-core:35271] Re: [Ruby 1.9-Bug#4359][Feedback] regular expressions created with Regexp::FIXEDENCODING have incorrect inspect --6TrnltStXW4iwmi0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Feb 15, 2011 at 04:23:24PM +0900, Yui NARUSE wrote: > Issue #4359 has been updated by Yui NARUSE. >=20 > Status changed from Open to Feedback >=20 > I don't think we must show Regexp#fixed_encoding? in Regexp#inspect. The problem is that Regexp#inspect is used for YAML dumping and loading: irb(main):001:0> require 'yaml' =3D> true irb(main):002:0> y =3D Regexp.new('', Regexp::FIXEDENCODING) =3D> // irb(main):003:0> x =3D YAML.load YAML.dump y =3D> // irb(main):004:0> x.options =3D> 0 irb(main):005:0> y.options =3D> 16 irb(main):006:0> YAML.dump y =3D> "--- !ruby/regexp //\n" irb(main):007:0> I suppose I could add a special case, but that seems strange. It also seems strange that inspect will not allow us to differentiate between regular expressions with different options. --=20 Aaron Patterson http://tenderlovemaking.com/ --6TrnltStXW4iwmi0 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (Darwin) iQEcBAEBAgAGBQJNXH5xAAoJEJUxcLy0/6/G5OcH/3E1AcYPA05N0EIHDKS/zP+p aoEXXZHkZtt2NXcV1Q4zf4r05KPj4pHhVLoJ8BktiOAsQ8ddPsnTbZEK6G2khaxU S2ia0Y7UimXi6f8jhmMKjEItjqh0GkdwVeB6MYNAMIbOjXD8I7z65ddRYpfVcr/O 2WufSQlcGqnk4vXvKInjcIodpOBvtlmPLUrZT16rkaLzkrdLmsRrq+9B32LAgmEJ OIicrVNgsXg4ePcODVo6+PR84at6/u0C4XPlsNssgpIfoUx+Nso71nAlRsvcPd4E Zr1sRzMxUFFrhMr6YOKOcD/vTOL0nwNOafulzq/Nh7xsiTyvbd9n4qYtk1VFgf0= =m9Iy -----END PGP SIGNATURE----- --6TrnltStXW4iwmi0--