Issue #14128 has been updated by gshutler (Garry Shutler).


Sorry, I thought I was recording it as a feature request. Thanks for fixing nobu.

----------------------------------------
Feature #14128: Introduce Hash#delete default value
https://bugs.ruby-lang.org/issues/14128#change-67917

* Author: gshutler (Garry Shutler)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
----------------------------------------
Mirror `Hash#fetch(key [, default]) вк obj` with `Hash#delete(key [, default]) вк obj`.

Allows for more concise extraction of a value from a hash with a default.

~~~ ruby
# Currently
a = hash.delete(:a) { 10 }

# Becomes
a = hash.delete(:a, 10)
~~~



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

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>