Francis Burton wrote: > Is there a construct like this in Ruby? > > if x in (1..5) > > This seems a lot more intuitive and easier to read than "(1..5) === x", > so is it possible to modify the language to make it do that? First of all: You usually wouldn't use ===, you'd use (1..5).include? x which is more readable in that it tells the reader what it does (=== is really only used for things like case and grep - you rarely (if ever) use it explicitly). To answer your question: Yes, it is: class Object def in?(collection) collection.include? self end end if x.in? 1..5 ... end For numbers there's also x.between?(1,5) HTH, Sebastian -- NP: Anathema - Harmonium Jabber: sepp2k / jabber.org ICQ: 205544826