From: Eric Hodel Date: 2003-02-21T08:23:55+09:00 Subject: Re: Array#=== (ps: bug in irb?) --Op27XXJsWz80g3oF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Chris Pine (nemo@hellotree.com) wrote: > Hello, >=20 > Just a thought: >=20 > class Array > def =3D=3D=3D obj > include? obj > end > end >=20 > (I couldn't try it out in irb, though, because it chokes on the `=3D=3D= =3D'. > Bug?) >=20 > Anyway, does anyone use Array#=3D=3D=3D is it currently is? Or has this = been > tried before? $ cat array.rb match =3D /(\w+) (\w+)/.match('foo bar')[1..2] case match when ['foo', 'bar'] puts 'foo bar' else puts "BUG!!!" end puts "changing Array#=3D=3D=3D" class Array def =3D=3D=3D obj include? obj end end case match when ['foo', 'bar'] puts 'foo bar' else puts 'BROKEN!!!' end $ ruby array.rb foo bar changing Array#=3D=3D=3D BROKEN!!! --=20 Eric Hodel - drbrain@segment7.net - http://segment7.net All messages signed with fingerprint: FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04 --Op27XXJsWz80g3oF Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (FreeBSD) iD8DBQE+VWOJMypVHHlsnwQRAvLCAKDlQSZtZ/oh0ixy0ylwpfVwglDUCwCgt1Ih NnnvW8pUZvLy1u96YOV5R5U= =f2sM -----END PGP SIGNATURE----- --Op27XXJsWz80g3oF--