On Nov 9, 5:13 ¨Âí¬ Ùõëéèéòï Íáôóõíïô¼í®®®Àòõâùìáîç®ïòç¾ ÷òïôåº > Hi, > > In message "Re: Hash#count" > on Thu, 5 Nov 2009 01:19:13 +0900, Intransition <transf... / gmail.com> writes: > > |Current: > | > | ¨Âºá½¾±¬ºâ½²¬ºã½¾±ý®ãïõîô¨Ûºá¬±Ý£½> | ¨Âºø½¾±¬ºâ½²¬ºã½¾±ý®ãïõîô¨Ûºá¬±Ý£½> | ¨Âºá½¾±¬ºâ½²¬ºã½¾±ý®ãïõîô¨±© ½¾ > | > |Proposed: > | > | ¨Âºá½¾±¬ºâ½²¬ºã½¾±ý®ãïõîô¨±© £½> | ¨Âºø½¾±¬ºâ½²¬ºã½¾±ý®ãïõîô¨±© £½> | > |It would be more useful that way. > > That is based on viewpoint to see hashes are collections of values > indexed by arbitrary object. ¨Âõô éî òåáìéôù¬ Òõâù èáóèåó áòäåóéçîåä > as collections of key-value pair. ¨Â áí îïðáòôéãõìáòìù áçáéîóôè> object-indexed view, but I am not going to change the existing method > behavior. Okay. I only point out, if Hash is a collection key-value pairs, I would expect Hash#include? to check pairs too. Personally I like to see methods behave according to most common uses, not an abstract viewpoint. I realize that is not always easy to determine (YMMV and all that), but I think it's a worthy pursuit nonetheless. > |And, in the same vain, a #has_pair? > |seems like an obvious addition. > > Let's address the issue one by one. Sure.