--1926193751-280810911-11920078760924 Content-Type: MULTIPART/MIXED; BOUNDARY="1926193751-280810911-1192007876=:10924" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --1926193751-280810911-11920078760924 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Hi -- On Wed, 10 Oct 2007, mortee wrote: > Peña wrote: >> From: Devi Web Development [mailto:devi.webmaster / gmail.com] >> # > compare: >> # > a3 = a1.select { |e| e.in? a2} >> # > >> # I really don't like that proposal. It's not a property of e >> # that it is in a2, its a property of a2 that it contains e. >> >> pls enlighten my poor brain :( >> >> i just want to ask if e is in a2. same way like i want to ask eg if e==2 ... in fact, i find #in? so generic... >> >> or maybe you want a keyword only like msbasic's >> >> e in a2 >> >> ? >> >> kind regards -botp >> > > Why don't you just define #in? in Object yourself, and then you can use > it anywhere in your code. That's something I really like about Ruby: if > I'm missing something from a core or library class, I can just drop it > in for my own use. It's not risk-free, though, since if two people define a given method differently, one of them will get trampled on. David -- Upcoming training from Ruby Power and Light, LLC: * Intro to Ruby on Rails, Edison, NJ, October 23-26 * Advancing with Rails, Edison, NJ, November 6-9 Both taught by David A. Black. See http://www.rubypal.com for more info! --1926193751-280810911-11920078760924-- --1926193751-280810911-11920078760924--