From: Mike Date: 2001-05-28T22:25:44+09:00 Subject: [ruby-talk:15866] Re: Experimental "in" operator for collections On Mon, 28 May 2001 21:40:04 +0900 Stefan Matthias Aust wrote: > There's one thing where I prefer Python over Ruby. Testing whether an > object is included in some collection happens so often, that a special > syntax just looks better. > > Just to test how Ruby would feel like, I modified the system to allow > > object in array > What about: object.in? array You can do this in pure ruby: class Object def in?(array) array.include? self end end Mike.