From: "Martin J. Dürst" Date: 2010-09-24T16:28:50+09:00 Subject: [ruby-core:32542] Re: [Ruby 1.9-Feature#3845][Open] "in" infix operator On 2010/09/23 4:41, Johan Holmberg wrote: > On Wed, Sep 22, 2010 at 1:48 AM, Yusuke ENDOH wrote: > I also like the "x in foo" infix syntax. I would expect it to be a > membership test, for example in the following situations: > > an_arr = [11,22,33] > a_set = Set.new([11,22,33]) > > p (10 in an_arr) # false > p (11 in an_arr) # true > p (10 in a_set) # false > p (11 in a_set) # true > > and probably similarly for other "collection type objects" too (I > believe it works something like that in Python). Just my two cents, but I don't see why this case is important enough to warrant deviating from the usual, object-oriented syntax (which may not always look optimal, but is easy and straightforward). Regards, Martin. -- #-# Martin J. D�rst, Professor, Aoyama Gakuin University #-# http://www.sw.it.aoyama.ac.jp mailto:duerst@it.aoyama.ac.jp