From: Martin DeMello Date: 2005-11-29T02:17:29+09:00 Subject: Re: [BUG] string range membership mental@rydia.net wrote: > Quoting Yukihiro Matsumoto : > > > In message "Re: [BUG] string range membership" > > on Tue, 29 Nov 2005 00:16:49 +0900, "Warren Brown" > writes: > > > > |Several names come to mind for the new method: #between? > > |(my personal favorite), #betwixt? (kind of silly, but could > > |be fun), #cover?, #surround?, #bound?, #inside?, #within?, > > |#in_range?, #in_interval?, #in? > > > > Thank you for the candidates. I'd like to hear opinion from > > others (especially from English speakers). > > #within? seems best to me. That reads better as obj.within?(range) than as range.within?(obj). I like #contain? personally, though in programming terms a "container" is more a set than a range. Actually, I'm all for #include? to mean bounding inclusion, and something a lot more expensive-sounding than member? for #to_a set inclusion. Something like "aaa"..."zzz".generates?("bbb") would at least indicate that it was doing an O(n) stepthrough of the range. martin