Issue #10177 has been updated by B Kelly.


Salutations,

First Last wrote:
> Tsuyoshi Sawada wrote:
> > I don't understand how `has_key?` is better
> 
> I already explained it, all I can do is restate it.
> 
> When the predicate consists of a just single noun or adjective, there is only enough information in it to ask one type of question (Are you?).

I wonder if this might be a circumstance where the Unix
philosophy of preferring shorter names for frequently used
operations might apply.

#key? must be presumably one of the most common queries to
Hash.


Regards,

Bill



----------------------------------------
Feature #10177: Hash#has_key? and Hash#has_value? should be deprecated
https://bugs.ruby-lang.org/issues/10177#change-48916

* Author: gogo tanaka
* Status: Open
* Priority: Normal
* Assignee: 
* Category: lib
* Target version: 
----------------------------------------
I referred to this Matz's remark.

http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/43765

And I agree with him, I supposed `Hash#has_key?` should be preferred over `Hash#key?`, 

so I replaced all of `Hash#has_key?` and `Hash#has_value?` in `lib/*` with `Hash#key?` and `Hash#value?` 

---Files--------------------------------
Replace_Hash#has_something.PATCH (20.4 KB)


-- 
https://bugs.ruby-lang.org/