[ruby-core:76880] [Ruby trunk Feature#12512] Import Hash#transform_values and its destructive version from ActiveSupport
From:
ruby-core@...
Date:
2016-08-15 15:20:50 UTC
List:
ruby-core #76880
Issue #12512 has been updated by Marc-Andre Lafortune.
Yukihiro Matsumoto wrote:
> From our discussion, we concerned `map_values` is too close to `map.values`, which has totally different semantics.
But isn't `map.values` non sensical?
{}.map.values # => NoMethodError: undefined method `values' for #<Enumerator: {}:map>
Moreover, it usually will be `map_values { |k,v| ... }` (i.e. followed by a block), while we never see `h.values { ... }`.
I don't see how there could be confusion here.
----------------------------------------
Feature #12512: Import Hash#transform_values and its destructive version from ActiveSupport
https://bugs.ruby-lang.org/issues/12512#change-60102
* Author: Kenta Murata
* Status: Open
* Priority: Normal
* Assignee: Kenta Murata
----------------------------------------
I think value transformation is a fundamental feature of Hash.
--
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>