From: Konrad Meyer Date: 2007-10-10T14:46:49+09:00 Subject: Re: will #in? be in ruby2? (was Re: Finding shared elements between to arrays.) --nextPart1314046.ZKGM57nK0N Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Quoth Pe=F1a, Botp: > Eric wrote: > > a3 =3D a1.select { |e| a2.include?(e) } > > >=20 > compare: > a3 =3D a1.select { |e| e.in? a2} >=20 > the latter is more straightforward. the former expression rocks my brain= =20 from left to right. >=20 > Can we see light for #in? in ruby2? (just asking since december is near := )=20 and i do not see it in mauricio's eigenclass site either) >=20 > kind regards -botp Array#include? arr =3D [:sym, 'str'] # =3D> [:sym, 'str'] arr.include? :sym # =3D> true HTH, =2D-=20 Konrad Meyer http://konrad.sobertillnoon.com/ --nextPart1314046.ZKGM57nK0N Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQBHDGXICHB0oCiR2cwRAhmsAJ9jekur8L9zEEPHhe1Lvn0/e86sQwCeNac0 PNof+aV6HT3Gx42k6MYj68s= =EolS -----END PGP SIGNATURE----- --nextPart1314046.ZKGM57nK0N--