From: Yusuke Endoh Date: 2010-09-21T21:56:31+09:00 Subject: [ruby-core:32488] [Ruby 1.9-Feature#3845] "in" infix operator Issue #3845 has been updated by Yusuke Endoh. Matz, Thank you for your comment! > |I'd propose "in" infix operator. > | > |( in ) yields true when is included in . > |Otherwise it yields false. > > I am neutral for this proposal. But the patch uses "case" internally > thus comparison is done by "===". Is this expected behavior? The patch is just proof of concept. I was not so particular about the implementation. But, I thought of the following code: if n in 5..10 # ... end This code works only when "===" is used (of course, unless range is specially handled). So I prefer "===". However, I'm happy to rewrite a patch if you say "==" should be used. -- Yusuke Endoh ---------------------------------------- http://redmine.ruby-lang.org/issues/show/3845 ---------------------------------------- http://redmine.ruby-lang.org